From 602f7d11acb731b30f232a585104a510970faff5 Mon Sep 17 00:00:00 2001 From: John Schember Date: Wed, 9 Mar 2011 07:30:46 -0500 Subject: [PATCH] add function to get download file name from url. Send filename when starting download and use filename. --- src/calibre/__init__.py | 29 +++++++++++++++++ src/calibre/gui2/store/web_control.py | 26 ++++------------ src/calibre/gui2/store_download.py | 45 +++++++++++---------------- 3 files changed, 53 insertions(+), 47 deletions(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index dbbb8b2296..9b9b473b5b 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -5,7 +5,9 @@ __docformat__ = 'restructuredtext en' import uuid, sys, os, re, logging, time, \ __builtin__, warnings, multiprocessing +from contextlib import closing from urllib import getproxies +from urllib2 import unquote as urllib2_unquote __builtin__.__dict__['dynamic_property'] = lambda(func): func(None) from htmlentitydefs import name2codepoint from math import floor @@ -479,6 +481,33 @@ def url_slash_cleaner(url): ''' return re.sub(r'(?