def crack_action(params): if params[1] == 'search': load_search(params[2]) elif params[1] == 'choose_file': callback = params[2] file_path = utils.open_file_chooser_dialog() webv.execute_script('%s("%s")' % (callback, file_path)) elif params[1] == 'save_avatar': img_uri = urllib.unquote(params[2]) avatar_file = urllib.unquote(params[3]) avatar_path = os.path.join(config.AVATAR_CACHE_DIR, avatar_file) if not (os.path.exists(avatar_path) and avatar_file.endswith(img_uri[img_uri.rfind('/')+1:])): print 'Download:', img_uri , 'To' , avatar_path th = threading.Thread( target = save_file_proc, args=(img_uri, avatar_path)) th.start() elif params[1] == 'log': print '\033[1;31;40m[%s]\033[0m %s' % (urllib.unquote(params[2]) ,urllib.unquote(params[3])) elif params[1] == 'paste_clipboard_text': webv.paste_clipboard(); elif params[1] == 'set_clipboard_text': clipboard = gtk.clipboard_get() text = list(params) del text[0:2] clipboard.set_text('/'.join(text))
def crack_action(params): if params[1] == 'user': screen_name = params[2] load_user(screen_name) elif params[1] == 'search': load_search(params[2]) elif params[1] == 'choose_file': callback = params[2] file_path = utils.open_file_chooser_dialog() webv.execute_script('%s("%s")' % (callback, file_path)) pass
def crack_action(params): if params[1] == 'search': load_search(params[2]) elif params[1] == 'choose_file': callback = params[2] file_path = utils.open_file_chooser_dialog() webv.execute_script('%s("%s")' % (callback, file_path)) elif params[1] == 'save_avatar': img_uri = urllib.unquote(params[2]) avatar_file = urllib.unquote(params[3]) avatar_path = os.path.join(config.get_path("avatar"), avatar_file) th = threading.Thread(target=save_file_proc, args=(img_uri, avatar_path)) th.start() elif params[1] == 'log': print '\033[1;31;40m[%s]\033[0m %s' % (urllib.unquote( params[2]), urllib.unquote(params[3])) elif params[1] == 'paste_clipboard_text': webv.paste_clipboard() elif params[1] == 'set_clipboard_text': webv.copy_clipboard()
def crack_action(params): if params[1] == 'search': load_search(params[2]) elif params[1] == 'choose_file': callback = params[2] file_path = utils.open_file_chooser_dialog() webv.execute_script('%s("%s")' % (callback, file_path)) elif params[1] == 'save_avatar': img_uri = urllib.unquote(params[2]) avatar_file = urllib.unquote(params[3]) avatar_path = os.path.join(config.get_path("avatar"), avatar_file) th = threading.Thread( target = save_file_proc, args=(img_uri, avatar_path)) th.start() elif params[1] == 'log': print '\033[1;31;40m[%s]\033[0m %s' % (urllib.unquote(params[2]) ,urllib.unquote(params[3])) elif params[1] == 'paste_clipboard_text': webv.paste_clipboard(); elif params[1] == 'set_clipboard_text': webv.copy_clipboard();