X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=webber.py;h=f3e0f63fec5c57e0d50dc37870d4630869e4c02d;hb=4a479e59364341cc7ac46fb59ce0a9c51d8cf8f8;hp=98b1106c48d4cfcc30da7cfa7abdd23df5cabf05;hpb=0de356a7eb42440f875243206ceebc1207ac6a8d;p=oss-web.git diff --git a/webber.py b/webber.py index 98b1106..f3e0f63 100644 --- a/webber.py +++ b/webber.py @@ -108,10 +108,15 @@ class File(Holder): #print "txt:", s.rstrip().encode("iso-8859-1") txt.append(s) + # Warn about a bogus time entries if self.mtime < self.ctime: log('%s: modification time cannot be before creation time' % self.rel_path) self.ctime = self.mtime + # Warn about long titles / long linktitles + if len(self.linktitle) > 20: + log('%s: define a shorter "linktitle: xxx"') + self.contents = "".join(txt) @@ -444,6 +449,13 @@ def get_time(): def get_current_file(): return current_file +@set_function("get_path_to_root") +def get_path_to_root(): + rel_path = relpath(directories[current_file.direc].abs_path, directories[''].abs_path) + rel_path = os.path.join(rel_path, os.path.split("")[1]) + if rel_path[-1] == "/": + rel_path = rel_path[:-1] + return rel_path @@ -501,7 +513,7 @@ def walk_tree(dirpath): direc.inheritFrom(cfg) if not rel_path: rel_path = "." - log("reading directory %s" % rel_path, level=4) + log("reading directory %s" % rel_path, level=5) for s in os.listdir(dirpath): full_path = os.path.join(dirpath, s)