Commit 0d13fd91 authored by D1plo1d's avatar D1plo1d

Chaging original_file_name => file_name in pronserve. Fixing the pause between print jobs options

parent 57c19bd9
...@@ -95,6 +95,7 @@ class JobsHandler(tornado.web.RequestHandler): ...@@ -95,6 +95,7 @@ class JobsHandler(tornado.web.RequestHandler):
def post(self): def post(self):
fileinfo = self.request.files['job'][0] fileinfo = self.request.files['job'][0]
printserve.do_add_job(fileinfo['filename'], fileinfo['body']) printserve.do_add_job(fileinfo['filename'], fileinfo['body'])
self.finish("ACK") self.finish("ACK")
class JobHandler(tornado.web.RequestHandler): class JobHandler(tornado.web.RequestHandler):
...@@ -359,12 +360,12 @@ class Printserve(pronsole.pronsole, EventEmitter): ...@@ -359,12 +360,12 @@ class Printserve(pronsole.pronsole, EventEmitter):
self.update_job_progress(100) self.update_job_progress(100)
self.fire("job_finished", self.jobs.sanitize(self.current_job)) self.fire("job_finished", self.jobs.sanitize(self.current_job))
if self.settings.pause_between_prints: if self.settings.pause_between_prints and self.current_job != None:
print "Print job complete. Pausing between jobs." print "Print job complete. Pausing between jobs."
self.current_job = None self.current_job = None
self.printing_jobs = False self.printing_jobs = False
elif len(self.jobs.list) > 0: elif len(self.jobs.list) > 0:
print "Print job complete. Starting the next print job" print "Starting the next print job"
self.current_job = self.jobs.list.pop(0) self.current_job = self.jobs.list.pop(0)
self.p.startprint(self.current_job['body'].split("\n")) self.p.startprint(self.current_job['body'].split("\n"))
self.fire("job_started", self.jobs.sanitize(self.current_job)) self.fire("job_started", self.jobs.sanitize(self.current_job))
...@@ -460,26 +461,26 @@ class PrintJobQueue(EventEmitter): ...@@ -460,26 +461,26 @@ class PrintJobQueue(EventEmitter):
def sanitize(self, job): def sanitize(self, job):
return dict( return dict(
id = job["id"], id = job["id"],
file_name = job["original_file_name"], file_name = job["file_name"],
) )
def add(self, original_file_name, body): def add(self, file_name, body):
ext = os.path.splitext(original_file_name)[1] ext = os.path.splitext(file_name)[1]
job = dict( job = dict(
id = self.__last_id, id = self.__last_id,
original_file_name=original_file_name, file_name=file_name,
body= body, body= body,
) )
self.__last_id += 1 self.__last_id += 1
self.list.append(job) self.list.append(job)
print "Added %s"%(original_file_name) print "Added %s"%(file_name)
self.fire("job_added", job) self.fire("job_added", job)
def display_summary(self): def display_summary(self):
print "Print Jobs:" print "Print Jobs:"
for job in self.list: for job in self.list:
print " %i: %s"%(job['id'], job['original_file_name']) print " %i: %s"%(job['id'], job['file_name'])
print "" print ""
return True return True
...@@ -502,7 +503,7 @@ class PrintJobQueue(EventEmitter): ...@@ -502,7 +503,7 @@ class PrintJobQueue(EventEmitter):
self.list.remove(job) self.list.remove(job)
self.list.insert(position, job) self.list.insert(position, job)
print int(job_attrs['position']) print int(job_attrs['position'])
print "Print #%s Job Updated ( %s )."%(job['id'], job['original_file_name']) print "Print #%s Job Updated ( %s )."%(job['id'], job['file_name'])
self.fire("job_updated", job) self.fire("job_updated", job)
def find_by_id(self, job_id): def find_by_id(self, job_id):
......
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