Commit 54ca8b05 authored by D1plo1d's avatar D1plo1d

Splitting prontserve __init__ and start into seperate methods so that the...

Splitting prontserve __init__ and start into seperate methods so that the server shutdown works more reliably.
parent 02dccd6a
...@@ -469,6 +469,7 @@ class Prontserve(pronsole.pronsole, EventEmitter): ...@@ -469,6 +469,7 @@ class Prontserve(pronsole.pronsole, EventEmitter):
self.jobs.listeners.add(self) self.jobs.listeners.add(self)
self.initializing = False self.initializing = False
def start(self):
if self.dry_run == False: if self.dry_run == False:
self.do_connect("") self.do_connect("")
if self.p.printer == None: sys.exit(1) if self.p.printer == None: sys.exit(1)
...@@ -908,9 +909,10 @@ if __name__ == "__main__": ...@@ -908,9 +909,10 @@ if __name__ == "__main__":
sys.stdout.write("\x1B[0;33m Dry Run \x1B[0m") sys.stdout.write("\x1B[0;33m Dry Run \x1B[0m")
print "" print ""
try: prontserve = Prontserve(dry_run=dry_run, loud=args.loud)
prontserve = Prontserve(dry_run=dry_run, loud=args.loud)
try:
prontserve.start()
application.listen(8888) application.listen(8888)
print "\n"+"-"*80 print "\n"+"-"*80
welcome = textwrap.dedent(u""" welcome = textwrap.dedent(u"""
...@@ -926,4 +928,5 @@ if __name__ == "__main__": ...@@ -926,4 +928,5 @@ if __name__ == "__main__":
prontserve.ioloop.start() prontserve.ioloop.start()
except: except:
if args.heaptrace: print hpy().heap() if args.heaptrace: print hpy().heap()
if 'prontserve' in vars(): prontserve.p.disconnect() prontserve.p.disconnect()
exit()
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