1
0
mirror of https://github.com/sashacmc/photo-importer.git synced 2025-02-16 18:34:34 +02:00
This commit is contained in:
Alexander Bushnev 2022-11-29 21:46:54 +01:00
parent 1b730285c4
commit 75dc881dbd
6 changed files with 12 additions and 9 deletions

View File

@ -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__':

View File

@ -1,7 +1,5 @@
#!/usr/bin/python3
import os
import sys
import unittest
import datetime

View File

@ -6,7 +6,6 @@ import threading
from . import log
from . import mover
from . import config
from . import rotator
from . import fileprop

View File

@ -1,7 +1,6 @@
#!/usr/bin/python3
import os
import sys
import unittest
import tempfile

View File

@ -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)

View File

@ -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)