Commit 4e0d75e2 authored by Guillaume Seguin's avatar Guillaume Seguin

Merge branch 'master' of github.com:kliment/Printrun

parents d4e01201 168163d5
...@@ -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)
...@@ -892,18 +893,26 @@ if __name__ == "__main__": ...@@ -892,18 +893,26 @@ if __name__ == "__main__":
help='Enables verbose printer output' help='Enables verbose printer output'
) )
parser.add_argument('--heaptrace', default=False, action='store_true',
help='Enables a heap trace on exit (for developer use)'
)
args = parser.parse_args() args = parser.parse_args()
dry_run = args.dry_run dry_run = args.dry_run
if args.heaptrace:
from guppy import hpy
def warn_if_dry_run(): def warn_if_dry_run():
if dry_run: if dry_run:
for i in range(0,7): for i in range(0,7):
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"""
...@@ -918,4 +927,6 @@ if __name__ == "__main__": ...@@ -918,4 +927,6 @@ if __name__ == "__main__":
prontserve.ioloop.start() prontserve.ioloop.start()
except: except:
if args.heaptrace: print hpy().heap()
prontserve.p.disconnect() prontserve.p.disconnect()
exit()
pybonjour pybonjour
git+https://github.com/nephics/tornado.git git+https://github.com/D1plo1d/tornado.git
git+https://github.com/D1plo1d/py-mdns.git git+https://github.com/D1plo1d/py-mdns.git
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