-USER = 'alphabethos' # pandora account name http://pandora.com/people/<USER>
-DIR = '/home/dylan/pandora/' # where to download the videos - will not be automatically created
-YT_DL = '/usr/bin/youtube-dl' # Path to youtube-dl
-NOTIFICATIONS = True # False
-DEFAULT_ICON ='/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-shockwave-flash.png' # for notifications
-YT_OPT = '--no-progress --ignore-errors --continue --max-quality=22 -o "%(stitle)s---%(id)s.%(ext)s"'
-# END OF SETTINGS
+import ConfigParser # This module has been renamed to configparser in python 3.0
+import sys
+import os
+
+CONFIG_FILE= os.path.join(os.path.expanduser('~'), '.i_like_pandora.config')
+config = ConfigParser.ConfigParser(default_options)
+loaded_files = config.read(CONFIG_FILE) # config.read returns an empty array if it fails.
+if len(loaded_files) == 0:
+ print 'Can\'t find a configuration file at', CONFIG_FILE
+ sys.exit()
+try:
+ USER = config.get('settings', 'username')
+ DIR = os.path.expanduser(config.get('settings', 'download_folder'))
+ NOTIFICATIONS = config.getboolean('settings', 'notifications')
+ YT_DL = config.get('settings', 'youtube-dl')
+ DEFAULT_ICON = config.get('settings', 'default_icon')
+except:
+ print 'There is a formatting error in the configuration file at', CONFIG_FILE
+ sys.exit()