mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
wrap
This commit is contained in:
parent
af00f229f6
commit
c175109f70
1 changed files with 5 additions and 2 deletions
|
@ -682,9 +682,12 @@ class FactEdit(QTextEdit):
|
|||
return
|
||||
|
||||
def _retrieveURL(self, url, ext):
|
||||
req = urllib2.Request(url, None, {'User-Agent': 'Mozilla/5.0 (compatible; Anki/%s)' % ankiqt.appVersion })
|
||||
req = urllib2.Request(url, None, {
|
||||
'User-Agent': 'Mozilla/5.0 (compatible; Anki/%s)' %
|
||||
ankiqt.appVersion })
|
||||
filecontents = urllib2.urlopen(req).read()
|
||||
(fd, name) = tempfile.mkstemp(prefix="anki", suffix=".%s" % ext.encode("ascii"))
|
||||
(fd, name) = tempfile.mkstemp(prefix="anki", suffix=".%s" %
|
||||
ext.encode("ascii"))
|
||||
file = os.fdopen(fd, "wb")
|
||||
file.write(filecontents)
|
||||
file.flush()
|
||||
|
|
Loading…
Reference in a new issue