def start_uploader(guimgr): listen_enabled = False while True: guimgr.start_search() song_list = db.get_tracks() if song_list == None: guimgr.no_music_found() while get_action() != 'options_changed': pass guimgr.activate() continue elif song_list == []: guimgr.no_new_music() get_action(300) continue if not fb.get_session_key(): guimgr.start_auth(db.upload_src) action = get_action() if action == 'options_changed': guimgr.activate() continue elif action != 'login_complete': raise Exception('Unknown action received') guimgr.end_auth() upload_files(song_list, guimgr) get_action(30)
def get_url(base_url): if '?' not in base_url: return base_url + '?session_key=' + fb.get_session_key() else: return base_url + '&session_key=' + fb.get_session_key()