pep8 style

This commit is contained in:
j 2017-02-18 13:02:21 +01:00
parent 6475bb8120
commit c35154ad3a

View file

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