Apply linting
This commit is contained in:
29
src/web.py
29
src/web.py
@@ -30,7 +30,7 @@ class Web(object):
|
||||
except Exception as e:
|
||||
self.app.logger.error(e)
|
||||
raise RuntimeError("Could not add SMS to queue, " + str(e)) from e
|
||||
self.app.logger.info("Added two new tasks at position %s and %s", sms, cut )
|
||||
self.app.logger.info("Added two new tasks at position %s and %s", sms, cut)
|
||||
return True
|
||||
|
||||
def print_image(self, image, sign: str) -> bool:
|
||||
@@ -46,19 +46,22 @@ class Web(object):
|
||||
if file_uploaded:
|
||||
self.app.logger.debug("File has been uploaded, printing...")
|
||||
try:
|
||||
img = self.print_queue.enqueue(ImageTask(os.path.join(
|
||||
self.app.config["UPLOAD_FOLDER"],
|
||||
secure_filename(image.filename),
|
||||
),
|
||||
signature=sign,
|
||||
process=True))
|
||||
img = self.print_queue.enqueue(
|
||||
ImageTask(
|
||||
os.path.join(
|
||||
self.app.config["UPLOAD_FOLDER"],
|
||||
secure_filename(image.filename),
|
||||
),
|
||||
signature=sign,
|
||||
process=True,
|
||||
)
|
||||
)
|
||||
|
||||
cut = self.print_queue.enqueue(CutTask())
|
||||
except Exception as e:
|
||||
raise RuntimeError("Could not add IMG to queue" + str(e)) from e
|
||||
|
||||
self.app.logger.info("Added two new tasks at position %s and %s", img, cut )
|
||||
|
||||
self.app.logger.info("Added two new tasks at position %s and %s", img, cut)
|
||||
|
||||
return True
|
||||
|
||||
@@ -96,10 +99,14 @@ class Web(object):
|
||||
)
|
||||
return True
|
||||
else:
|
||||
self.app.logger.error("Could not save file because the filename is forbidden")
|
||||
self.app.logger.error(
|
||||
"Could not save file because the filename is forbidden"
|
||||
)
|
||||
return False
|
||||
else:
|
||||
self.app.logger.error("Could not save file, it seems to be null ? : " + str(filename))
|
||||
self.app.logger.error(
|
||||
"Could not save file, it seems to be null ? : " + str(filename)
|
||||
)
|
||||
return False
|
||||
|
||||
def get_queue_state(self):
|
||||
|
||||
Reference in New Issue
Block a user