diff --git a/web_serving/SimpleWebPage.py b/web_serving/SimpleWebPage.py index 19b3581..d863440 100755 --- a/web_serving/SimpleWebPage.py +++ b/web_serving/SimpleWebPage.py @@ -43,8 +43,8 @@ def generate_index(opts): f.write(get_header(opts.title)) if opts.parent: f.write(get_pathlink('..')) - for pa in dirs: - f.write(get_pathlink(pa)) + for di in dirs: + f.write(get_pathlink(path,di)) for fi in files: f.write(get_filelink(path,fi)) f.write(get_footer()) @@ -58,10 +58,10 @@ def get_filelink(path,fname): fdstr=time.strftime("%Y/%m/%d %H:%M:%S",fdate) return ''+fname+''+fsstr+''+fdstr+'\n' -def get_pathlink(path): - fdate=time.localtime(os.path.getmtime(path)) +def get_pathlink(path,dname): + fdate=time.localtime(os.path.getmtime(os.path.join(path,dname))) fdstr=time.strftime("%Y/%m/%d %H:%M:%S",fdate) - return ''+path+'[DIR]'+fdstr+'\n' + return ''+dname+'[DIR]'+fdstr+'\n' def get_header(title): header='''