Some cleanup and preperation for better packaging.

master
daid 2012-05-31 12:05:10 +02:00
parent 7acb66fcdb
commit 5b7e60e163
45 changed files with 16 additions and 381 deletions

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -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 )

View File

@ -1,6 +1,3 @@
from __future__ import absolute_import
import __init__
import sys, os, subprocess import sys, os, subprocess
def hasExporer(): def hasExporer():

View File

@ -1,13 +1,10 @@
from __future__ import absolute_import
import __init__
import sys import sys
import math import math
import re import re
import os import os
from util import util3d import util3d
from util import profile import profile
class gcodePath(object): class gcodePath(object):
def __init__(self, newType, pathType, layerThickness, startPoint): def __init__(self, newType, pathType, layerThickness, startPoint):

View File

@ -1,9 +1,6 @@
from __future__ import absolute_import
import __init__
import sys, math, re, os, struct, time import sys, math, re, os, struct, time
from util import util3d import util3d
class meshFace(object): class meshFace(object):
def __init__(self, v0, v1, v2): def __init__(self, v0, v1, v2):

View File

@ -272,7 +272,10 @@ global globalPreferenceParser
globalPreferenceParser = None globalPreferenceParser = None
def getPreferencePath(): 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): def getPreferenceFloat(name):
try: try:

View File

@ -2,7 +2,11 @@ from __future__ import absolute_import
import platform, os, subprocess, sys 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 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. #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" "Return the path to the pypy executable if we can find it. Else return False"
if platform.system() == "Windows": if platform.system() == "Windows":
exeName = "pypy.exe" 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: else:
exeName = "pypy" 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): if os.path.exists(pypyExe):
return pypyExe return pypyExe

View File

@ -1,10 +1,7 @@
from __future__ import absolute_import
import __init__
import sys, math, re, os, struct, time import sys, math, re, os, struct, time
from util import util3d import util3d
from util import mesh import mesh
class stlModel(mesh.mesh): class stlModel(mesh.mesh):
def __init__(self): def __init__(self):

View File

@ -1,4 +1,3 @@
import math import math
class Vector3(object): class Vector3(object):

View File

@ -1,6 +1,3 @@
from __future__ import absolute_import
import __init__
import os import os
def getVersion(): def getVersion():