Minor cleanups in pronsole.py

Command line option parsing really needs a better rework, to use optparse or
argparse and support gcode/stl filename argument.
master
Guillaume Seguin 2013-05-16 11:45:52 +02:00
parent a46f73595e
commit c5cb9a9926
1 changed files with 1 additions and 5 deletions

View File

@ -20,6 +20,7 @@ import glob, os, time, datetime
import sys, subprocess import sys, subprocess
import math, codecs import math, codecs
from math import sqrt from math import sqrt
import getopt
import printcore import printcore
from printrun.printrun_utils import install_locale from printrun.printrun_utils import install_locale
@ -179,9 +180,6 @@ class pronsole(cmd.Cmd):
self.helpdict["z_feedrate"] = _("Feedrate for Control Panel Moves in Z (default: 200mm/min)") self.helpdict["z_feedrate"] = _("Feedrate for Control Panel Moves in Z (default: 200mm/min)")
self.helpdict["final_command"] = _("Executable to run when the print is finished") self.helpdict["final_command"] = _("Executable to run when the print is finished")
self.commandprefixes='MGT$' self.commandprefixes='MGT$'
self.webrequested = False
self.web_config = None
self.web_auth_config = None
self.promptstrs = {"offline" : "%(bold)suninitialized>%(normal)s ", self.promptstrs = {"offline" : "%(bold)suninitialized>%(normal)s ",
"fallback" : "%(bold)sPC>%(normal)s ", "fallback" : "%(bold)sPC>%(normal)s ",
"macro" : "%(bold)s..>%(normal)s ", "macro" : "%(bold)s..>%(normal)s ",
@ -1210,10 +1208,8 @@ class pronsole(cmd.Cmd):
self.log("home xyze - homes all axes and zeroes the extruder (Using G28 and G92)") self.log("home xyze - homes all axes and zeroes the extruder (Using G28 and G92)")
def parse_cmdline(self, args): def parse_cmdline(self, args):
import getopt
opts, args = getopt.getopt(args, "c:e:hw", ["conf = ", "config = ", "help"]) opts, args = getopt.getopt(args, "c:e:hw", ["conf = ", "config = ", "help"])
for o, a in opts: for o, a in opts:
#self.log(repr((o, a)))
if o in ("-c", "--conf", "--config"): if o in ("-c", "--conf", "--config"):
self.load_rc(a) self.load_rc(a)
elif o in ("-h", "--help"): elif o in ("-h", "--help"):