Commit 27a266b2 authored by D1plo1d's avatar D1plo1d

Throwing an error when prontserve recieves a print command but there are no...

Throwing an error when prontserve recieves a print command but there are no print jobs in the queue.
parent 2e9ee973
...@@ -445,8 +445,10 @@ class Prontserve(pronsole.pronsole, EventEmitter): ...@@ -445,8 +445,10 @@ class Prontserve(pronsole.pronsole, EventEmitter):
sdRef.close() sdRef.close()
def do_print(self): def do_print(self):
if not self.p.online: raise Exception("not online") if not self.p.online: raise Exception("Not online")
if self.printing_jobs: raise Exception("already printing") if self.printing_jobs: raise Exception("Already printing")
no_jobs_msg = "Nothing to print. Try adding a print job with add_job."
if len(self.jobs.list) == 0: raise Exception(no_jobs_msg)
self.printing_jobs = True self.printing_jobs = True
def do_home(self, *args, **kwargs): def do_home(self, *args, **kwargs):
......
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