mirror of
https://github.com/sashacmc/photo-importer.git
synced 2025-02-16 18:34:34 +02:00
Cleanup
This commit is contained in:
parent
1b730285c4
commit
75dc881dbd
@ -221,7 +221,9 @@ class FilePropRes(object):
|
||||
if path is None:
|
||||
path = self.__path
|
||||
|
||||
return self.__prop_ptr._out_name_full(path, self.__out_name, self.__ext)
|
||||
return self.__prop_ptr._out_name_full(
|
||||
path, self.__out_name, self.__ext
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
|
@ -6,7 +6,6 @@ import threading
|
||||
|
||||
from . import log
|
||||
from . import mover
|
||||
from . import config
|
||||
from . import rotator
|
||||
from . import fileprop
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
import tempfile
|
||||
|
||||
|
@ -7,7 +7,6 @@ import tempfile
|
||||
import subprocess
|
||||
import concurrent.futures
|
||||
|
||||
from . import config
|
||||
|
||||
JPEGTRAN_COMMAND = {
|
||||
0: None,
|
||||
@ -126,7 +125,9 @@ class Rotator(object):
|
||||
) as p:
|
||||
line = p.stderr.readline()
|
||||
if line:
|
||||
logging.error('jpegtran (%s) failed: %s' % (filename, line))
|
||||
logging.error(
|
||||
'jpegtran (%s) failed: %s' % (filename, line)
|
||||
)
|
||||
return False
|
||||
|
||||
self.__clear_orientation_tag(tmpfile)
|
||||
|
@ -157,7 +157,9 @@ class PhotoImporterHandler(http.server.BaseHTTPRequestHandler):
|
||||
100.0 * stat[stage]['processed'] / stat['total']
|
||||
)
|
||||
elif stage == 'done':
|
||||
cerr = stat['move']['errors'] + stat['rotate']['errors']
|
||||
cerr = (
|
||||
stat['move']['errors'] + stat['rotate']['errors']
|
||||
)
|
||||
if cerr != 0:
|
||||
r['state'] = 'error'
|
||||
r['total'] = cerr
|
||||
@ -279,7 +281,9 @@ class PhotoImporterHandler(http.server.BaseHTTPRequestHandler):
|
||||
try:
|
||||
if (path[0]) == '/':
|
||||
path = path[1:]
|
||||
fname = os.path.normpath(os.path.join(self.server.web_path(), path))
|
||||
fname = os.path.normpath(
|
||||
os.path.join(self.server.web_path(), path)
|
||||
)
|
||||
if not fname.startswith(self.server.web_path()):
|
||||
logging.warning('incorrect path: ' + path)
|
||||
raise HTTPError(HTTPStatus.NOT_FOUND, path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user