From c35154ad3a18cab02fd7bef1ea07e32a5dc71a99 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 18 Feb 2017 13:02:21 +0100 Subject: [PATCH] pep8 style --- ox/movie.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ox/movie.py b/ox/movie.py index 48fbe34..cbf591d 100644 --- a/ox/movie.py +++ b/ox/movie.py @@ -29,7 +29,7 @@ def format_path(data, directory_key='director'): director = data['directorSort'] or ['Unknown Director'] title = data['seriesTitle' if data['isEpisode'] else 'title'] or 'Untitled' year = data['seriesYear' if data['isEpisode'] else 'year'] or None - parts = list(map(format_underscores, filter(lambda x: x != None, [ + parts = list(map(format_underscores, filter(lambda x: x is not None, [ u'; '.join(director[:10]), u'%s%s' % (title, u' (%s)' % year if year else ''), u'%s%s%s%s%s%s' % ( @@ -60,7 +60,7 @@ def parse_item_files(files): def get_version_key(file, extension=True): return '%s/%s-part/%s' % ( file['version'] or '', - 'single' if file['part'] == None else 'multi', + 'single' if file['part'] is None else 'multi', file['extension'] if extension else '' ) # filter out duplicate files (keep shortest path, sorted alphabetically) @@ -272,12 +272,12 @@ def parse_path(path, directory_key='director'): # isEpisode, seriesTitle, seriesYear data['isEpisode'] = False data['seriesTitle'] = data['seriesYear'] = None - if data['season'] != None or data['episode'] != None or data['episodes']: + if data['season'] is not None or data['episode'] is not None or data['episodes']: data['isEpisode'] = True data['seriesTitle'] = data['title'] - season = 'S%02d' % data['season'] if data['season'] != None else '' + season = 'S%02d' % data['season'] if data['season'] is not None else '' episode = '' - if data['episode'] != None: + if data['episode'] is not None: episode = 'E%02d' % data['episode'] elif data['episodes']: episode = 'E%02d%s%02d' % ( @@ -379,9 +379,9 @@ def parse_movie_path(path): season = match.group(3) episode = match.group(5) episodeTitle = (match.group(6) or '').strip() - if episode != None: + if episode is not None: episode = int(episode) - if season != None: + if season is not None: season = int(season) if episode and not season: season = 1 @@ -399,7 +399,7 @@ def parse_movie_path(path): else: episode = None - if episode and 'Episode %d'%episode in fileparts: + if episode and 'Episode %d' % episode in fileparts: episodeTitle = fileparts.index('Episode %d' % episode) + 1 episodeTitle = fileparts[episodeTitle] if episodeTitle == extension or episodeTitle.startswith('Part'):