indir = sys.argv[1]
outdir=indir
-html_files = glob.glob( os.path.join(indir, '*.html') )
+os.chdir(indir)
+
+html_files = glob.glob( '*.html' )
# messy way to get all languages
langs_set = set()
if (len(file_split) == 2):
# it's English
lang = ''
+ # possibly necessary for automatic language selection
+ file_symlink =file.replace(".html", ".en.html")
+ os.symlink (file, file_symlink)
else:
# it's a translation
lang = file_split[1]
# ick
lang_footer = makeFooter(lang, out_filename.split('.')[0])
- outfile = open( os.path.join(outdir, out_filename), 'w')
+ outfile = open( out_filename, 'w')
for line in lines:
# avoid external links
if ((line.find("href") >= 0) and (line.find("http")==-1)):