projects
/
winfreed.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b0483c0
)
Add some debug print when the filename could not be guessed
author
Antonio Ospite <ospite@studenti.unina.it>
Mon, 19 Sep 2011 10:13:29 +0000
(12:13 +0200)
committer
Antonio Ospite <ospite@studenti.unina.it>
Mon, 19 Sep 2011 10:13:29 +0000
(12:13 +0200)
winfreed.py
patch
|
blob
|
history
diff --git
a/winfreed.py
b/winfreed.py
index
c465b63
..
b9da36e
100755
(executable)
--- a/
winfreed.py
+++ b/
winfreed.py
@@
-59,10
+59,15
@@
def download(entry):
response = urllib2.urlopen(url)
filename = urllib2.unquote(os.path.basename(response.geturl()))
response = urllib2.urlopen(url)
filename = urllib2.unquote(os.path.basename(response.geturl()))
+ if filename == "":
+ sys.stderr.write("Debug (%s): filename: %s url: %s\n" %(entry['package'], filename, response.geturl()))
+ return
+
destfile = os.path.join(OUTPUT_DIR, filename)
if os.path.exists(destfile):
destfile = os.path.join(OUTPUT_DIR, filename)
if os.path.exists(destfile):
- sys.stderr.write("Warning
: %s exists!\n" % destfile
)
+ sys.stderr.write("Warning
(%s): %s exists!\n" % (entry['package'], destfile)
)
return
return
+
outfile = open(destfile, mode='w')
total_size = response.info().getheader('Content-Length').strip()
outfile = open(destfile, mode='w')
total_size = response.info().getheader('Content-Length').strip()