from Cura.util import resources
from Cura.util import version
+ #If we do not have preferences yet, try to load it from a previous Cura install
+ if profile.getPreference('machine_type') == 'unknown':
+ try:
+ otherCuraInstalls = profile.getAlternativeBasePaths()
+ otherCuraInstalls.sort()
+ profile.loadPreferences(os.path.join(otherCuraInstalls[-1], 'preferences.ini'))
+ profile.loadProfile(os.path.join(otherCuraInstalls[-1], 'current_profile.ini'))
+ except:
+ print sys.exc_info()
+
#If we haven't run it before, run the configuration wizard.
if profile.getPreference('machine_type') == 'unknown':
if platform.system() == "Windows":
self.Bind(wx.EVT_MENU, lambda e: self.scene.showPrintWindow(), i)
i = self.fileMenu.Append(-1, 'Save GCode...')
self.Bind(wx.EVT_MENU, lambda e: self.scene.showSaveGCode(), i)
+ i = self.fileMenu.Append(-1, 'Show slice engine log...')
+ self.Bind(wx.EVT_MENU, lambda e: self.scene._showSliceLog(), i)
self.fileMenu.AppendSeparator()
i = self.fileMenu.Append(-1, 'Open Profile...')
os.makedirs(basePath)
return basePath
+def getAlternativeBasePaths():
+ paths = []
+ basePath = os.path.normpath(os.path.join(getBasePath(), '..'))
+ for subPath in os.listdir(basePath):
+ path = os.path.join(basePath, subPath)
+ if os.path.isdir(path) and os.path.isfile(os.path.join(path, 'preferences.ini')) and path != getBasePath():
+ paths.append(path)
+ path = os.path.join(basePath, subPath, 'Cura')
+ if os.path.isdir(path) and os.path.isfile(os.path.join(path, 'preferences.ini')) and path != getBasePath():
+ paths.append(path)
+ return paths
+
def getDefaultProfilePath():
return os.path.join(getBasePath(), 'current_profile.ini')
pluginError = profile.runPostProcessingPlugins(self._exportFilename)
if pluginError is not None:
print pluginError
+ self._sliceLog.append(pluginError)
self._callback(1.0, True)
else:
for line in self._sliceLog: