Commit 1a90feb2 authored by Kliment Yanev's avatar Kliment Yanev

Fix command line handling for stl files with spaces in the name

parent 5b0e0c98
...@@ -1135,13 +1135,14 @@ class pronsole(cmd.Cmd): ...@@ -1135,13 +1135,14 @@ class pronsole(cmd.Cmd):
try: try:
import shlex import shlex
if(settings): if(settings):
param = self.expandcommand(self.settings.sliceoptscommand).encode() param = self.expandcommand(self.settings.sliceoptscommand).replace("\\","\\\\").encode()
print "Entering skeinforge settings: ",param print "Entering skeinforge settings: ",param
subprocess.call(shlex.split(param)) subprocess.call(shlex.split(param))
else: else:
param = self.expandcommand(self.settings.slicecommand).replace("$s",l[0]).replace("$o",l[0].replace(".stl","_export.gcode").replace(".STL","_export.gcode")).encode() param = self.expandcommand(self.settings.slicecommand).encode()
print "Slicing: ",param print "Slicing: ",param
subprocess.call(shlex.split(param)) params=[i.replace("$s",l[0]).replace("$o",l[0].replace(".stl","_export.gcode").replace(".STL","_export.gcode")).encode() for i in shlex.split(param.replace("\\","\\\\").encode())]
subprocess.call(params)
print "Loading skeined file." print "Loading skeined file."
self.do_load(l[0].replace(".stl","_export.gcode")) self.do_load(l[0].replace(".stl","_export.gcode"))
except Exception,e: except Exception,e:
......
...@@ -1257,12 +1257,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1257,12 +1257,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def skein_func(self): def skein_func(self):
try: try:
import shlex import shlex
param = self.expandcommand(self.settings.slicecommand).replace("$s",self.filename).replace("$o",self.filename.replace(".stl","_export.gcode").replace(".STL","_export.gcode")).encode() param = self.expandcommand(self.settings.slicecommand).encode()
print shlex.split(param.replace("\\","\\\\"))
print "Slicing: ",param print "Slicing: ",param
self.cancelskein=0 pararray=[i.replace("$s",self.filename).replace("$o",self.filename.replace(".stl","_export.gcode").replace(".STL","_export.gcode")).encode() for i in shlex.split(param.replace("\\","\\\\").encode())]
#p=subprocess.Popen(param,shell=True,bufsize=10,stderr=subprocess.STDOUT,stdout=subprocess.PIPE,close_fds=True)
pararray=shlex.split(param.replace("\\","\\\\"))
#print pararray #print pararray
self.skeinp=subprocess.Popen(pararray,stderr=subprocess.STDOUT,stdout=subprocess.PIPE) self.skeinp=subprocess.Popen(pararray,stderr=subprocess.STDOUT,stdout=subprocess.PIPE)
while True: while True:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment