-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix quoting of query string and dl of answer sound
- Loading branch information
1 parent
c5dcd1d
commit 2d10416
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
# mentalcalculation - version 0.4.2 | ||
# mentalcalculation - version 0.4.3 | ||
# Copyright (C) 2008-2020, solsTiCe d'Hiver <[email protected]> | ||
|
||
# This program is free software; you can redistribute it and/or modify | ||
|
@@ -64,7 +64,7 @@ | |
DIGIT = dict([(i,(int('1'+'0'*(i-1)), int('9'*i))) for i in range(1,10)]) | ||
|
||
appName = 'mentalcalculation' | ||
appVersion = '0.4.2' | ||
appVersion = '0.4.3' | ||
|
||
SHARE_PATH = '.' | ||
SHARE_PATH = pathlib.Path(SHARE_PATH).absolute() | ||
|
@@ -528,7 +528,7 @@ def downloadSounds(self): | |
t = ' '.join(list(t)).replace('- ', '-') | ||
if t not in self.sounds: | ||
self.query.update({'number': t, 'lang': LANG}) | ||
query_string = '&'.join(f'{k}={v}' for k,v in self.query.items()) | ||
query_string = '&'.join(f'{k}={urllib.parse.quote(v)}' for k,v in self.query.items()) | ||
url = f'{APIURL}?{query_string}' | ||
t = Thread(target=dl_thread, args=(url, t, self.sounds, self.ui.statusbar, self.tr, nb_dls)) | ||
t.start() | ||
|
@@ -539,7 +539,8 @@ def downloadSounds(self): | |
if self.one_digit: | ||
t = ' '.join(list(t)).replace('- ', '-') | ||
if t not in self.sounds: | ||
query_string = '&'.join(f'{k}={v}' for k,v in self.query.items()) | ||
self.query.update({'number': t, 'lang': LANG}) | ||
query_string = '&'.join(f'{k}={urllib.parse.quote(v)}' for k,v in self.query.items()) | ||
url = f'{APIURL}?{query_string}' | ||
t = Thread(target=dl_thread, args=(url, t, self.sounds, self.ui.statusbar, self.tr, nb_dls)) | ||
t.start() | ||
|