simplified url generation in dir-preview

master
Stefan Krulj 14 years ago
parent 7aaff84d4f
commit 5d613ca454
  1. 5
      pylog.py
  2. 1
      pylog_config.py

@ -99,8 +99,7 @@ def disp_file_dict(d,keys):
name = os.path.basename(f)
if typ in prev_actions and not os.path.isdir(f):
sys.stdout.write('<h1><a class="entryheader" href="'+script+'?')
sys.stdout.write(urllib.urlencode({'path': os.path.normpath(os.path.dirname(f)), \
'disp':os.path.normpath(f)}).replace('&','&amp;')+'">')
sys.stdout.write('disp='+os.path.normpath(f)+'">')
print name+'</a> - <span class="entrydate">',
print datetime.fromtimestamp(int(k)).strftime(cfg.datefmt),
print '</span>&nbsp;'
@ -202,7 +201,7 @@ else:
print " <title>"+name+"</title>"
link = ET.Element("link")
link.text = cfg.topurl+script+'?'+urllib.urlencode({'path': os.path.normpath(os.path.dirname(f)),'disp':os.path.normpath(f)})
link.text = cfg.topurl+script+'?'+'disp='+os.path.normpath(f)
print " ",
ET.dump(link)
link.tag="guid"

@ -22,6 +22,7 @@ datefmt='%Y-%m-%d'
contentdir="cnt"
# directory where the content is located
numofposts=5
# number of previews on the base site
numfeed=5

Loading…
Cancel
Save