out_f.write (page_flavors[k][1])
out_f.close()
# if the page is translated, a .en.html symlink is necessary for content negotiation
- if target == 'online' and ext_list != ['']:
+ if target == 'online' and ext_list != [''] and not os.path.lexists (name_filter (prefix + '.en.html')):
os.symlink (os.path.basename (prefix) + '.html', name_filter (prefix + '.en.html'))
lang = ''
# possibly necessary for automatic language selection
file_symlink = file.replace(".html", ".en.html")
- if (not (os.path.exists(file_symlink))):
+ if not os.path.lexists (file_symlink):
os.symlink (file, file_symlink)
elif (len(file_split) == 3):
# it's a translation
for l in symlinks:
p = mirrortree.new_link_path (os.path.normpath (os.readlink (l)), os.path.dirname (l), strip_re)
dest = strip_file_name[t] (l)
- if not os.path.exists (dest):
+ if not os.path.lexists (dest):
os.symlink (p, dest)