3737DEFAULT_PREFIX_FORMAT = r'%Y-%m-%d--%H-%M-%S-UTC_'
3838
3939
40+ def is_login_successful (g ):
41+ return g .doc .text_search ("frame_content" ) or g .doc .text_search ("server_export.php" )
42+ 43+ 44+ def open_frame_if_phpmyadmin_3 (g ):
45+ frame_url_selector = g .doc .select ("id('frame_content')/@src" )
46+ if frame_url_selector .exists ():
47+ g .go (frame_url_selector .text ())
48+ 49+ 4050def download_sql_backup (url , user , password , dry_run = False , overwrite_existing = False , prepend_date = True , basename = None ,
4151 output_directory = os .getcwd (), exclude_dbs = None , compression = 'none' , prefix_format = None ,
4252 timeout = 60 , http_auth = None ):
@@ -53,10 +63,11 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
5363 g .doc .set_input_by_id ('input_password' , password )
5464 g .submit ()
5565
56- try :
57- g .doc .text_assert ('server_export.php' )
58- except Exception as e :
66+ if not is_login_successful (g ):
5967 raise ValueError ('Could not login - did you provide the correct username / password? ({})' .format (e ))
68+ 69+ open_frame_if_phpmyadmin_3 (g )
70+ 6071 export_url = g .doc .select ("id('topmenu')//a[contains(@href,'server_export.php')]/@href" ).text ()
6172 g .go (export_url )
6273
0 commit comments