Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 284e62e

Browse files
committed
Fix flake warnings.
1 parent eedfec0 commit 284e62e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

python2.7/music-autoplaylists.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from mutagen.easyid3 import EasyID3
1717
from collections import defaultdict
1818

19+
1920
def main():
2021
parser = argparse.ArgumentParser()
2122
parser.add_argument('--musicDir', type=str, default='.')
@@ -24,9 +25,11 @@ def main():
2425

2526
genres = defaultdict(list)
2627
for dpath, dnames, fnames in os.walk(args.musicDir):
27-
if '.git' in dpath: continue
28+
if '.git' in dpath:
29+
continue
2830
for fname in fnames:
29-
if os.path.splitext(fname)[1] != '.mp3': continue
31+
if os.path.splitext(fname)[1] != '.mp3':
32+
continue
3033
p = os.path.abspath(os.path.join(dpath, fname))
3134
audio = EasyID3(p)
3235
if 'genre' in audio:
@@ -41,13 +44,15 @@ def main():
4144
os.makedirs(args.playlistDir)
4245

4346
for genre, songs in genres.items():
44-
p = os.path.join(args.playlistDir, genre+'.m3u')
47+
p = os.path.join(args.playlistDir, genre + '.m3u')
4548
print("Creating playlist: {}".format(p))
4649
with open(p, 'w') as f:
4750
f.write("#EXTM3U\n")
48-
f.write("\n".join(sorted(songs))+"\n")
51+
f.write("\n".join(sorted(songs)) + "\n")
4952

5053
# Maps a string such as 'The Beatles' to 'the-beatles'.
54+
55+
5156
def toNeat(s):
5257
s = s.lower().replace("&", "and")
5358

0 commit comments

Comments
 (0)