Skip to content

Commit 05880e9

Browse files
author
Jason Harper
committed
Update to work with new versions of Grab library
1 parent ee0b9fb commit 05880e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

phpmyadmin_sql_backup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
5252

5353
g.doc.set_input_by_id('input_username', user)
5454
g.doc.set_input_by_id('input_password', password)
55-
g.doc.submit()
55+
g.submit()
5656

5757
try:
5858
g.doc.text_assert('server_export.php')
@@ -67,13 +67,13 @@ def download_sql_backup(url, user, password, dry_run=False, overwrite_existing=F
6767
print('Warning: no databases to dump (databases available: "{}")'.format('", "'.join(dbs_available)),
6868
file=sys.stderr)
6969

70-
file_response = g.doc.submit(
70+
file_response = g.submit(
7171
extra_post=[('db_select[]', db_name) for db_name in dbs_to_dump] + [('compression', compression)])
7272

73-
re_match = CONTENT_DISPOSITION_FILENAME_RE.match(g.response.headers['Content-Disposition'])
73+
re_match = CONTENT_DISPOSITION_FILENAME_RE.match(g.doc.headers['Content-Disposition'])
7474
if not re_match:
7575
raise ValueError(
76-
'Could not determine SQL backup filename from {}'.format(g.response.headers['Content-Disposition']))
76+
'Could not determine SQL backup filename from {}'.format(g.doc.headers['Content-Disposition']))
7777

7878
content_filename = re_match.group('filename')
7979
filename = content_filename if basename is None else basename + os.path.splitext(content_filename)[1]

0 commit comments

Comments
 (0)