Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c6cca8c7a3
3 changed files with 12 additions and 10 deletions
|
|
@ -23,7 +23,7 @@ printWindowMonitorHandle = None
|
|||
|
||||
def printFile(filename):
|
||||
global printWindowMonitorHandle
|
||||
if printWindowMonitorHandle == None:
|
||||
if printWindowMonitorHandle is None:
|
||||
printWindowMonitorHandle = printProcessMonitor()
|
||||
printWindowMonitorHandle.loadFile(filename)
|
||||
|
||||
|
|
@ -47,11 +47,11 @@ class printProcessMonitor():
|
|||
self.handle = None
|
||||
|
||||
def loadFile(self, filename):
|
||||
if self.handle == None:
|
||||
if self.handle is None:
|
||||
if platform.system() == "Darwin" and hasattr(sys, 'frozen'):
|
||||
cmdList = [os.path.join(os.path.dirname(sys.executable), 'Cura')]
|
||||
else:
|
||||
cmdList = [sys.executable, sys.argv[0]]
|
||||
cmdList = [sys.executable, '-m', 'Cura.cura']
|
||||
cmdList.append('-r')
|
||||
cmdList.append(filename)
|
||||
if platform.system() == "Darwin":
|
||||
|
|
@ -68,8 +68,8 @@ class printProcessMonitor():
|
|||
def Monitor(self):
|
||||
p = self.handle
|
||||
line = p.stdout.readline()
|
||||
while(len(line) > 0):
|
||||
#print line.rstrip()
|
||||
while len(line) > 0:
|
||||
print line.rstrip()
|
||||
line = p.stdout.readline()
|
||||
p.communicate()
|
||||
self.handle = None
|
||||
|
|
@ -90,7 +90,7 @@ class PrintCommandButton(buttons.GenBitmapButton):
|
|||
self.Bind(wx.EVT_BUTTON, self.OnClick)
|
||||
|
||||
def OnClick(self, e):
|
||||
if self.parent.machineCom == None or self.parent.machineCom.isPrinting():
|
||||
if self.parent.machineCom is None or self.parent.machineCom.isPrinting():
|
||||
return;
|
||||
for cmd in self.commandList:
|
||||
self.parent.machineCom.sendCommand(cmd)
|
||||
|
|
|
|||
|
|
@ -661,16 +661,18 @@ class projectPlanner(wx.Frame):
|
|||
pspw.Show(True)
|
||||
|
||||
def OnScaleChange(self, e):
|
||||
if self.selection == None:
|
||||
if self.selection is None:
|
||||
return
|
||||
try:
|
||||
self.selection.scale = float(self.scaleCtrl.GetValue())
|
||||
except ValueError:
|
||||
self.selection.scale = 1.0
|
||||
if self.alwaysAutoPlace:
|
||||
self.OnAutoPlace(None)
|
||||
self.preview.Refresh()
|
||||
|
||||
def OnRotateChange(self, e):
|
||||
if self.selection == None:
|
||||
if self.selection is None:
|
||||
return
|
||||
self.selection.rotate = float(self.rotateCtrl.GetValue())
|
||||
self.selection.updateModelTransform()
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ Section "Open STL files with Cura"
|
|||
DeleteRegValue HKCR .stl "Content Type"
|
||||
WriteRegStr HKCR "Cura STL model file\DefaultIcon" "" "$INSTDIR\Cura\resources\stl.ico,0"
|
||||
WriteRegStr HKCR "Cura STL model file\shell" "" "open"
|
||||
WriteRegStr HKCR "Cura STL model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" "$INSTDIR\Cura\cura.py" "%1"'
|
||||
WriteRegStr HKCR "Cura STL model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" -c "import os; os.chdir(\"$INSTDIR\"); import Cura.cura; Cura.cura.main()" "%1"'
|
||||
SectionEnd
|
||||
|
||||
Section /o "Open OBJ files with Cura"
|
||||
|
|
@ -129,7 +129,7 @@ Section /o "Open OBJ files with Cura"
|
|||
DeleteRegValue HKCR .obj "Content Type"
|
||||
WriteRegStr HKCR "Cura OBJ model file\DefaultIcon" "" "$INSTDIR\Cura\resources\stl.ico,0"
|
||||
WriteRegStr HKCR "Cura OBJ model file\shell" "" "open"
|
||||
WriteRegStr HKCR "Cura OBJ model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" "$INSTDIR\Cura\cura.py" "%1"'
|
||||
WriteRegStr HKCR "Cura OBJ model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" -c "import os; os.chdir(\"$INSTDIR\"); import Cura.cura; Cura.cura.main()" "%1"'
|
||||
SectionEnd
|
||||
|
||||
;--------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue