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

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

Loading…
Cancel
Save