fixed up a few issues found from linter

This commit is contained in:
2021-03-19 17:49:48 +11:00
parent ef0971f6a3
commit 6fd0205b71
2 changed files with 11 additions and 11 deletions

View File

@@ -12,6 +12,7 @@
###
### SQLALCHEMY IMPORTS ###
# pylint: disable=no-member
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Sequence, Float, ForeignKey, DateTime, LargeBinary, Boolean
@@ -37,7 +38,7 @@ import hashlib
import exifread
import base64
import numpy
import cv2
from cv2 import cv2
import socket
import threading
import io
@@ -507,7 +508,7 @@ def GetDateFromFile(file, stat):
print(f"trying exif read of {file}")
f = open(file, 'rb')
tags = exifread.process_file(f)
date_str, time_str = str(tags["EXIF DateTimeOriginal"]).split(" ")
date_str, _ = str(tags["EXIF DateTimeOriginal"]).split(" ")
print(date_str)
year, month, day = date_str.split(":")
year=int(year)
@@ -868,7 +869,7 @@ def RemoveDups(job):
dup_cnt=0
for jex in job.extra:
if 'kfid-' in jex.name:
pfx, which = jex.name.split('-')
_, which = jex.name.split('-')
hash=[jex.value for jex in job.extra if jex.name == f"kfhash-{which}"][0]
AddLogForJob(job, f"deleting duplicate files with hash: {hash} but keeping file with DB id={jex.value}" )
files=session.query(Entry).join(File).filter(File.hash==hash).all()
@@ -892,7 +893,7 @@ def RemoveDups(job):
dup_cnt += 1
if 'kdid-' in jex.name:
pfx, which = jex.name.split('-')
_, which = jex.name.split('-')
hashes=[jex.value for jex in job.extra if jex.name == f"kdhash-{which}"][0]
keeping=jex.value
tmp=session.query(Dir).filter(Dir.eid==keeping).first()