Commit 4c33a905 authored by Keegi's avatar Keegi

Merge remote branch 'kliment/master'

parents 19ec2502 41c4f604
......@@ -610,6 +610,51 @@ class pronsole(cmd.Cmd):
print "monitor - Reports temperature and SD print status (if SD printing) every 5 seconds"
print "monitor 2 - Reports temperature and SD print status (if SD printing) every 2 seconds"
def do_skein(self,l):
l=l.split()
if len(l)==0:
print "No file name given."
return
print "Skeining file:"+l[0]
if not(os.path.exists(l[0])):
print "File not found!"
return
if not os.path.exists("skeinforge"):
print "Skeinforge not found. \nPlease copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
return
if not os.path.exists("skeinforge/__init__.py"):
with open("skeinforge/__init__.py","w"):
pass
try:
from skeinforge.skeinforge_application.skeinforge_utilities import skeinforge_craft
if(len(l)>1):
if(l[1] == "view"):
skeinforge_craft.writeOutput(l[0],True)
else:
skeinforge_craft.writeOutput(l[0],False)
else:
skeinforge_craft.writeOutput(l[0],False)
print "Loading skeined file."
self.do_load(l[0].replace(".stl","_export.gcode"))
except:
print "Skeinforge execution failed."
raise
def complete_skein(self, text, line, begidx, endidx):
s=line.split()
if len(s)>2:
return []
if (len(s)==1 and line[-1]==" ") or (len(s)==2 and line[-1]!=" "):
if len(s)>1:
return [i[len(s[1])-len(text):] for i in glob.glob(s[1]+"*/")+glob.glob(s[1]+"*.stl")]
else:
return glob.glob("*/")+glob.glob("*.stl")
def help_skein(self):
print "Creates a gcode file from an stl model using skeinforge (with tab-completion)"
print "skein filename.stl - create gcode file"
print "skein filename.stl view - create gcode file and view using skeiniso"
interp=pronsole()
try:
......
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