Skip to content

Commit

Permalink
final changes to app
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu authored and Ubuntu committed Sep 16, 2012
1 parent e3e44f3 commit 28fc01f
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 193 deletions.
16 changes: 9 additions & 7 deletions app.py
Expand Up @@ -39,14 +39,14 @@ def convert(person):
print >>fp, station
for song in songs.find({"station": station, "has_uri": 1}):
print >>fp, song['uri']
refresh_tables()
fp.close()
return filename

def run_spotify_tool(person, filename):
spotify_cmd = "./pandorify "+person['s_uname']+" "+ person['s_pword']+" "+filename
process = None
def target():
logging.info("Spotify process started")
logging.info("Spotify process started with cmd: "+spotify_cmd)
process = subprocess.Popen(spotify_cmd, shell=True, stderr=subprocess.PIPE)
(stdout, stderr) = process.communicate()
logging.info("Spotify process finished")
Expand All @@ -55,7 +55,7 @@ def target():
thread = threading.Thread(target=target)
thread.start()

thread.join(10000)
thread.join(20000)
if thread.is_alive():
logging.info("Spotify hung, restarting")
process.terminate()
Expand Down Expand Up @@ -87,12 +87,14 @@ def run(self):
format_songs(songs, email)
logging.debug("Calling spotify tools")
filename = convert(pandora_user)
while not run_spotify_tool(person, filename):
pass
self.queue.task_done()
if person['s_uname'] and person['s_pword']:
while not run_spotify_tool(person, filename):
pass
logging.info("Finished processing person")
sendEmail(email, person['user_email'])

#refresh_tables()
self.queue.task_done()

t = ThreadCrawler(queue)
t.setDaemon(True)
t.start()
Expand Down
Binary file modified app.pyc
Binary file not shown.
185 changes: 0 additions & 185 deletions logs/app.log

This file was deleted.

Binary file modified pandorify_c/tmp/Storage/index.dat
Binary file not shown.
Binary file modified pandorify_c/tmp/Users/bish3al-user/offline2
Binary file not shown.
Binary file modified pandorify_c/tmp/Users/bish3al-user/playlist.bnk
Binary file not shown.
Binary file modified pandorify_c/tmp/Users/bish3al-user/social_manager.bnk
Binary file not shown.
Binary file modified pandorify_c/tmp/offline.bnk
Binary file not shown.
2 changes: 1 addition & 1 deletion pandorify_c/tmp/settings
@@ -1 +1 @@
{"autologin_username":"bish3al","autologin_canonical_username":"bish3al","autologin_mode":0,"proxy_pass":"","realtime_clock_delta":-5,"csrf":""}
{"autologin_username":"bish3al","autologin_canonical_username":"bish3al","autologin_mode":0,"proxy_pass":"","realtime_clock_delta":-6,"csrf":""}

0 comments on commit 28fc01f

Please sign in to comment.