From: daid Date: Thu, 31 May 2012 10:05:10 +0000 (+0200) Subject: Some cleanup and preperation for better packaging. X-Git-Tag: 12.07~44^2~11 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5b7e60e163fea688b202af517afd1d6097dac556;p=cura.git Some cleanup and preperation for better packaging. --- diff --git a/Cura/__init__.py b/Cura/__init__.py index 6e968ba1..e69de29b 100644 --- a/Cura/__init__.py +++ b/Cura/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 0 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/avr_isp/__init__.py b/Cura/avr_isp/__init__.py index 16380337..e69de29b 100644 --- a/Cura/avr_isp/__init__.py +++ b/Cura/avr_isp/__init__.py @@ -1,13 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys - -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/__init__.py b/Cura/cura_sf/__init__.py index bdac25da..e69de29b 100644 --- a/Cura/cura_sf/__init__.py +++ b/Cura/cura_sf/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/__init__.py b/Cura/cura_sf/fabmetheus_utilities/__init__.py index 16380337..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/__init__.py @@ -1,13 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys - -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/__init__.py b/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/__init__.py index 2dc8ddc9..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 2 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/__init__.py b/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/__init__.py index cefa3e7c..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/__init__.py @@ -1,12 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/__init__.py index 3345e964..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/__init__.py @@ -1,12 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 2 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/creation/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/creation/__init__.py index cefa3e7c..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/creation/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/creation/__init__.py @@ -1,12 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/path_elements/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/path_elements/__init__.py index 58ec332e..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/path_elements/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_tools/path_elements/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 4 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/__init__.py index cefa3e7c..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/__init__.py @@ -1,12 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/__init__.py index 58ec332e..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_elements/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 4 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_enumerables/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_enumerables/__init__.py index 58ec332e..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_enumerables/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_enumerables/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 4 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/__init__.py index 58ec332e..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 4 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_matrix/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_matrix/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_matrix/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_matrix/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_meta/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_meta/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_meta/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_meta/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_paths/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_paths/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_paths/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_paths/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_shapes/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_shapes/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_shapes/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/manipulation_shapes/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/solids/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/solids/__init__.py index cefa3e7c..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/solids/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/solids/__init__.py @@ -1,12 +0,0 @@ -""" -This page is in the table of contents. -This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -""" -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry/statements/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry/statements/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry/statements/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry/statements/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/__init__.py index 2dc8ddc9..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 2 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/creation/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/creation/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/creation/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/creation/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_matrix/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_matrix/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_matrix/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_matrix/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_meta/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_meta/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_meta/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_meta/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_paths/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_paths/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_paths/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_paths/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_shapes/__init__.py b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_shapes/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_shapes/__init__.py +++ b/Cura/cura_sf/fabmetheus_utilities/geometry_plugins/manipulation_shapes/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/__init__.py b/Cura/cura_sf/skeinforge_application/__init__.py index bdac25da..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/__init__.py +++ b/Cura/cura_sf/skeinforge_application/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/__init__.py index 2dc8ddc9..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 2 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/analyze_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/analyze_plugins/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/analyze_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/analyze_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/__init__.py index 58ec332e..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 4 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/static_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/static_plugins/__init__.py index b83e9418..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/static_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/static_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 5 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/meta_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/meta_plugins/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/meta_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/meta_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/profile_plugins/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/profile_plugins/__init__.py index 1121e8ab..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_plugins/profile_plugins/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_plugins/profile_plugins/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 3 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/cura_sf/skeinforge_application/skeinforge_utilities/__init__.py b/Cura/cura_sf/skeinforge_application/skeinforge_utilities/__init__.py index 2dc8ddc9..e69de29b 100644 --- a/Cura/cura_sf/skeinforge_application/skeinforge_utilities/__init__.py +++ b/Cura/cura_sf/skeinforge_application/skeinforge_utilities/__init__.py @@ -1,9 +0,0 @@ -#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module. -import os -import sys -numberOfLevelsDeepInPackageHierarchy = 2 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/gui/__init__.py b/Cura/gui/__init__.py index 4870325b..e69de29b 100644 --- a/Cura/gui/__init__.py +++ b/Cura/gui/__init__.py @@ -1,9 +0,0 @@ -import os -import sys - -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/util/__init__.py b/Cura/util/__init__.py index 4870325b..e69de29b 100644 --- a/Cura/util/__init__.py +++ b/Cura/util/__init__.py @@ -1,9 +0,0 @@ -import os -import sys - -numberOfLevelsDeepInPackageHierarchy = 1 -packageFilePath = os.path.abspath(__file__) -for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ): - packageFilePath = os.path.dirname( packageFilePath ) -if packageFilePath not in sys.path: - sys.path.insert( 0, packageFilePath ) diff --git a/Cura/util/exporer.py b/Cura/util/exporer.py index 5eca1416..c729243a 100644 --- a/Cura/util/exporer.py +++ b/Cura/util/exporer.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -import __init__ - import sys, os, subprocess def hasExporer(): diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index 78e71acb..9abcacc1 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -1,13 +1,10 @@ -from __future__ import absolute_import -import __init__ - import sys import math import re import os -from util import util3d -from util import profile +import util3d +import profile class gcodePath(object): def __init__(self, newType, pathType, layerThickness, startPoint): diff --git a/Cura/util/mesh.py b/Cura/util/mesh.py index 1dbd8cd7..c2198486 100644 --- a/Cura/util/mesh.py +++ b/Cura/util/mesh.py @@ -1,9 +1,6 @@ -from __future__ import absolute_import -import __init__ - import sys, math, re, os, struct, time -from util import util3d +import util3d class meshFace(object): def __init__(self, v0, v1, v2): diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 235f1c38..23e2888a 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -272,7 +272,10 @@ global globalPreferenceParser globalPreferenceParser = None def getPreferencePath(): - return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../preferences.ini")) + basePath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")) + if os.path.basename(basePath) == 'library.zip': + basePath = os.path.normpath(os.path.join(basePath, "..")) + return os.path.normpath(os.path.join(basePath, "preferences.ini")) def getPreferenceFloat(name): try: diff --git a/Cura/util/sliceRun.py b/Cura/util/sliceRun.py index 47f585d0..bc3b98f7 100644 --- a/Cura/util/sliceRun.py +++ b/Cura/util/sliceRun.py @@ -2,7 +2,11 @@ from __future__ import absolute_import import platform, os, subprocess, sys -from cura_sf.skeinforge_application.skeinforge_utilities import skeinforge_craft +cura_sf_path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../cura_sf/")) +if cura_sf_path not in sys.path: + sys.path.append(cura_sf_path) +from skeinforge_application.skeinforge_utilities import skeinforge_craft + from util import profile #How long does each step take compared to the others. This is used to make a better scaled progress bar, and guess time left. @@ -32,10 +36,10 @@ def getPyPyExe(): "Return the path to the pypy executable if we can find it. Else return False" if platform.system() == "Windows": exeName = "pypy.exe" - pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe")); + pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/pypy.exe")) else: exeName = "pypy" - pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/bin/pypy")); + pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy/bin/pypy")) if os.path.exists(pypyExe): return pypyExe diff --git a/Cura/util/stl.py b/Cura/util/stl.py index 7e3e6421..8b87a417 100644 --- a/Cura/util/stl.py +++ b/Cura/util/stl.py @@ -1,10 +1,7 @@ -from __future__ import absolute_import -import __init__ - import sys, math, re, os, struct, time -from util import util3d -from util import mesh +import util3d +import mesh class stlModel(mesh.mesh): def __init__(self): diff --git a/Cura/util/util3d.py b/Cura/util/util3d.py index b5140b27..43146a7e 100644 --- a/Cura/util/util3d.py +++ b/Cura/util/util3d.py @@ -1,4 +1,3 @@ - import math class Vector3(object): diff --git a/Cura/util/version.py b/Cura/util/version.py index 98c9ea5f..2c27a551 100644 --- a/Cura/util/version.py +++ b/Cura/util/version.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -import __init__ - import os def getVersion():