Commit fca22b6b authored by Gerion Entrup's avatar Gerion Entrup
Browse files

walker: PEP8

parent 619d0f3d
......@@ -3,12 +3,10 @@ import mutagen
import threading
import logging
from sqlalchemy.orm import Session
from model import Recording
from utils import pairwise
from collector import Paths
class Walker(threading.Thread):
def __init__(self, session_fac, sourcedir):
super().__init__(target=self)
......@@ -31,12 +29,14 @@ class Walker(threading.Thread):
self.log.info('Unknown file type: {}'.format(filepath))
continue
except Exception as err:
self.log.error('Unexpected exception: {}, Path: {}'.format(err, filepath))
self.log.error(
'Unexpected exception: {}, Path: {}'.format(err,
filepath))
continue
if mut is not None:
mbid = self.get_mbid(mut)
if mbid is not None and mbid not in self._mbids:
Paths.put((mbid,os.path.abspath(filepath)))
Paths.put((mbid, os.path.abspath(filepath)))
self._mbids.add(mbid)
def get_mbid(self, mut):
......@@ -54,6 +54,6 @@ class Walker(threading.Thread):
if mut[key][0].dataformat == mutagen.mp4.AtomDataType.UTF8:
return mut[key][0].decode('utf8')
else:
raise Exception('MP4 could not be parsed correctly. Dataformat is not UTF8')
raise Exception('MP4 could not be parsed correctly. ' +
'Dataformat is not UTF8')
return None
Supports Markdown
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