commit
39245779d8
|
@ -177,10 +177,10 @@ class pronsole(cmd.Cmd):
|
||||||
self.p.disconnect()
|
self.p.disconnect()
|
||||||
cmd.Cmd.postloop(self)
|
cmd.Cmd.postloop(self)
|
||||||
|
|
||||||
def preloop(self):
|
def load_rc(self,rc_filename=".pronsolerc"):
|
||||||
self.processing_rc=True
|
self.processing_rc=True
|
||||||
try:
|
try:
|
||||||
rc=open(os.path.join(os.path.expanduser("~"),".pronsolerc"))
|
rc=open(os.path.join(os.path.expanduser("~"),rc_filename))
|
||||||
for rc_cmd in rc:
|
for rc_cmd in rc:
|
||||||
if not rc_cmd.lstrip().startswith("#"):
|
if not rc_cmd.lstrip().startswith("#"):
|
||||||
self.onecmd(rc_cmd)
|
self.onecmd(rc_cmd)
|
||||||
|
@ -188,6 +188,9 @@ class pronsole(cmd.Cmd):
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
self.processing_rc=False
|
self.processing_rc=False
|
||||||
|
|
||||||
|
def preloop(self):
|
||||||
|
self.load_rc()
|
||||||
print "Welcome to the printer console! Type \"help\" for a list of available commands."
|
print "Welcome to the printer console! Type \"help\" for a list of available commands."
|
||||||
cmd.Cmd.preloop(self)
|
cmd.Cmd.preloop(self)
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Tee(object):
|
||||||
|
|
||||||
class PronterWindow(wx.Frame,pronsole.pronsole):
|
class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
def __init__(self, filename=None,size=winsize):
|
def __init__(self, filename=None,size=winsize):
|
||||||
|
pronsole.pronsole.__init__(self)
|
||||||
self.filename=filename
|
self.filename=filename
|
||||||
os.putenv("UBUNTU_MENUPROXY","0")
|
os.putenv("UBUNTU_MENUPROXY","0")
|
||||||
wx.Frame.__init__(self,None,title="Printer Interface",size=size);
|
wx.Frame.__init__(self,None,title="Printer Interface",size=size);
|
||||||
|
@ -99,6 +100,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
|
||||||
self.t=Tee(self.catchprint)
|
self.t=Tee(self.catchprint)
|
||||||
self.stdout=sys.stdout
|
self.stdout=sys.stdout
|
||||||
self.mini=False
|
self.mini=False
|
||||||
|
self.load_rc(".pronsolerc")
|
||||||
|
|
||||||
|
|
||||||
def do_extrude(self,l=""):
|
def do_extrude(self,l=""):
|
||||||
|
|
Loading…
Reference in New Issue