mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Avoid duplicate html files with names like 'index.htm'
This commit is contained in:
parent
9438fdf3e5
commit
eb904062ad
@ -28,6 +28,7 @@ import urllib
|
||||
import textwrap
|
||||
import urlparse
|
||||
import os, os.path
|
||||
|
||||
import errno
|
||||
import hashlib
|
||||
import httplib
|
||||
@ -616,7 +617,8 @@ def url_to_filename(url):
|
||||
lpath = L[2].split('/')
|
||||
if not '.' in lpath[-1]:
|
||||
# url ends with a directory name. Store it under index.html.
|
||||
L[2] += '/' + INDEX_HTML
|
||||
# L[2] += '/' + INDEX_HTML
|
||||
L[2]=L[2]
|
||||
else:
|
||||
# 'title=' parsing
|
||||
if L[4].startswith('title=') and L[2].endswith('index.php'):
|
||||
@ -692,7 +694,7 @@ def url_to_filename(url):
|
||||
# Not really needed since we checked that the directory
|
||||
# outdir didn't exist at the top of run(), but let's double check.
|
||||
if os.path.exists(ans) and not config.overwrite:
|
||||
out.write('File already exists: ' + str(ans))
|
||||
out.write('File already exists: ' + str(ans)) #@UndefinedVariable
|
||||
sys.exit(1)
|
||||
|
||||
f = open(ans, mode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user