|
|
|
|
@ -24,7 +24,7 @@ def dir_link(name,f,depth,hidden): |
|
|
|
|
if hidden: |
|
|
|
|
print ' hidden', |
|
|
|
|
print '">' |
|
|
|
|
print ' <a class="menulink" href="'+script+'?'+ urllib.urlencode({'path': os.path.normpath(f)}).replace('&','&') +'">'+name+'</a>' |
|
|
|
|
print ' <a class="menulink" href="'+script+'?'+'path='+os.path.normpath(f)+'">'+name+'</a>' |
|
|
|
|
print ' </li>' |
|
|
|
|
def file_link(name,f,depth,hidden): |
|
|
|
|
script = sys.argv[0][sys.argv[0].rindex('/')+1:] |
|
|
|
|
@ -32,7 +32,7 @@ def file_link(name,f,depth,hidden): |
|
|
|
|
if hidden: |
|
|
|
|
print ' hidden', |
|
|
|
|
print '">' |
|
|
|
|
print ' <a class="menulink" href="'+script+'?'+ urllib.urlencode({'path': os.path.normpath(os.path.dirname(f)), 'disp':os.path.normpath(f)}).replace('&','&') +'">'+name+'</a>' |
|
|
|
|
print ' <a class="menulink" href="'+script+'?'+'disp='+os.path.normpath(f)+'">'+name+'</a>' |
|
|
|
|
print ' </li>' |
|
|
|
|
|
|
|
|
|
def disp_txt(path): |
|
|
|
|
@ -68,7 +68,15 @@ class BodyParser(HTMLParser): |
|
|
|
|
def handle_charref(self,ref): |
|
|
|
|
if self.body: |
|
|
|
|
self.src += '&'+ref+';' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Legacy code used vim for syntax highlighting, as this could be usefull, |
|
|
|
|
# I'll keep it here |
|
|
|
|
# old disp_source using vim |
|
|
|
|
#def disp_source(path): |
|
|
|
|
# print '<div class="sourcecode">' |
|
|
|
|
# print get_source_html(path).encode(cfg.encoding) |
|
|
|
|
# #print source |
|
|
|
|
# print '</div>' |
|
|
|
|
def get_source_html(path): |
|
|
|
|
tmpdir = os.path.join(tempfile.gettempdir(),"pylog") |
|
|
|
|
cache=False |
|
|
|
|
@ -137,13 +145,6 @@ def disp_source(path,lang,line_numbers): |
|
|
|
|
f.close() |
|
|
|
|
print '</div>' |
|
|
|
|
|
|
|
|
|
# old disp_source using vim |
|
|
|
|
#def disp_source(path): |
|
|
|
|
# print '<div class="sourcecode">' |
|
|
|
|
# print get_source_html(path).encode(cfg.encoding) |
|
|
|
|
# #print source |
|
|
|
|
# print '</div>' |
|
|
|
|
|
|
|
|
|
def disp(path): |
|
|
|
|
print '<div class="entrytext">' |
|
|
|
|
f = codecs.open(path, mode="r", encoding=cfg.encoding)(path) |
|
|
|
|
|