diff --git a/comment_section.py b/comment_section.py new file mode 100644 index 0000000..7aaf585 --- /dev/null +++ b/comment_section.py @@ -0,0 +1,40 @@ +import urllib, os +import pylog_config as cfg + +__commentanchor="#disqus_thread" #The anchor name of the comment section + +def comments_init(): + print """""" + +def disp_comments(file): + """
+ + + blog comments powered by Disqus""" + + +def disp_num_of_comments(file): + sys.stdout.write('') diff --git a/pylog.py b/pylog.py index 20e71d8..e3863fe 100755 --- a/pylog.py +++ b/pylog.py @@ -11,6 +11,7 @@ from datetime import datetime from pylog_action import * import pylog_config as cfg +import comment_section __version = "v0.1-(2012-03-15)" @@ -71,6 +72,10 @@ def disp_list(path): files = {} for f in os.listdir(path): f = os.path.normpath(os.path.join(path,f)) + + if get_valid_path(f)==cfg.contentdir: + continue + if not os.path.isdir(f): if not os.path.getmtime(f) in files: files[os.path.getmtime(f)]=[f] @@ -99,9 +104,9 @@ def disp_file_dict(d,keys): print name+' - ', print datetime.fromtimestamp(int(k)).strftime(cfg.datefmt), print ' ' - sys.stdout.write('') + + comment_section.disp_num_of_comments(f) + print '' prev_actions[typ](f) @@ -150,7 +155,7 @@ def get_newest(n): def get_valid_path(path): if '..' in path or os.path.normpath(path)=='.': return cfg.contentdir - valid_chars='. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/_0123456789' + valid_chars='. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/_-0123456789' for c in path: if not c in valid_chars: return cfg.contentdir @@ -228,6 +233,7 @@ print '' print ('