mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 08:09:32 +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 textwrap
|
||||||
import urlparse
|
import urlparse
|
||||||
import os, os.path
|
import os, os.path
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import hashlib
|
import hashlib
|
||||||
import httplib
|
import httplib
|
||||||
@ -616,7 +617,8 @@ def url_to_filename(url):
|
|||||||
lpath = L[2].split('/')
|
lpath = L[2].split('/')
|
||||||
if not '.' in lpath[-1]:
|
if not '.' in lpath[-1]:
|
||||||
# url ends with a directory name. Store it under index.html.
|
# url ends with a directory name. Store it under index.html.
|
||||||
L[2] += '/' + INDEX_HTML
|
# L[2] += '/' + INDEX_HTML
|
||||||
|
L[2]=L[2]
|
||||||
else:
|
else:
|
||||||
# 'title=' parsing
|
# 'title=' parsing
|
||||||
if L[4].startswith('title=') and L[2].endswith('index.php'):
|
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
|
# Not really needed since we checked that the directory
|
||||||
# outdir didn't exist at the top of run(), but let's double check.
|
# outdir didn't exist at the top of run(), but let's double check.
|
||||||
if os.path.exists(ans) and not config.overwrite:
|
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)
|
sys.exit(1)
|
||||||
|
|
||||||
f = open(ans, mode)
|
f = open(ans, mode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user