From: Dylan Lloyd Date: Tue, 18 Jan 2011 05:32:15 +0000 (-0500) Subject: Fixed loading of pynotify and other modules when notifications are disabled. X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=bad942a65c4dbc72457bf548701c8baecee0461d;p=i_like_pandora.git Fixed loading of pynotify and other modules when notifications are disabled. --- diff --git a/likes_pandora.py b/likes_pandora.py index cd066e8..c787863 100644 --- a/likes_pandora.py +++ b/likes_pandora.py @@ -6,21 +6,22 @@ __license__ = "BSD" USER = 'alphabethos' DIR = '/home/dylan/pandora/' YT_DL = '/usr/bin/youtube-dl' # Path to youtube-dl -NOTIFICATIONS = True +NOTIFICATIONS = True # False DEFAULT_ICON ='/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-shockwave-flash.png' YT_OPT = '--no-progress --ignore-errors --continue --max-quality=22 -o "%(stitle)s---%(id)s.%(ext)s"' # END OF SETTINGS +from BeautifulSoup import BeautifulSoup import urllib import urllib2 -from BeautifulSoup import BeautifulSoup import pynotify import tempfile import string -import hashlib -import os -import shlex, subprocess -import re +if NOTIFICATIONS: + import hashlib + import os + import shlex, subprocess + import re def fetch_stations(user): """ This takes a pandora username and returns the a list of the station tokens that the user is subscribed to. """