Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- albumbler 2011-04-29 00:45:09.363948970 -0500
- +++ albumbler.ignore_playlists 2011-04-29 01:45:18.090617318 -0500
- @@ -14,7 +14,8 @@
- 'max_playlist': 1000,
- 'min_playlist': 3,
- 'notify': 'console',
- - 'player': 'mocp'}
- + 'player': 'mocp',
- + 'ignoreplaylists': False}
- """
- playlist is a cached list of all directories/playlists.
- @@ -61,7 +62,8 @@
- def dir_tree(dir_root):
- tree = list(os.walk(dir_root))
- dirs = [t[0] for t in tree]
- - playlists = [os.path.join(t[0],f) for t in tree for f in t[2] if os.path.splitext(f)[1] in playlist_exts]
- + if conf['ignoreplaylists'] == False: playlists = [os.path.join(t[0],f) for t in tree for f in t[2] if os.path.splitext(f)[1] in playlist_exts]
- + else: playlists = []
- return dirs + playlists
- def reasonable_dir(path):
- @@ -167,6 +169,7 @@
- cp.set('Settings', 'MinPlaylist', str(conf['min_playlist']))
- cp.set('Settings', 'Notify', str(conf['notify']))
- cp.set('Settings', 'Player', str(conf['player']))
- + cp.set('Settings', 'IgnorePlaylists', str(conf['ignoreplaylists']))
- cp.write(open(config_path, 'wb'))
- cp = ConfigParser.RawConfigParser()
- cp.read(config_path)
- @@ -175,6 +178,7 @@
- conf['max_playlist'] = cp.getint('Settings', 'MaxPlaylist')
- conf['notify'] = cp.get('Settings', 'Notify')
- conf['player'] = cp.get('Settings', 'Player')
- + conf['ignoreplaylists'] = cp.get('Settings', 'IgnorePlaylists')
- try: # ewww, hacky
- conf['min_playlist'] = cp.getint('Settings', 'MinPlaylist')
- except ConfigParser.NoOptionError:
Advertisement
Add Comment
Please, Sign In to add comment