From bad942a65c4dbc72457bf548701c8baecee0461d Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Tue, 18 Jan 2011 00:32:15 -0500 Subject: [PATCH] Fixed loading of pynotify and other modules when notifications are disabled. --- likes_pandora.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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. """ -- 2.30.2