continue
#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)
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
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)
if ok:
#print "FILE", s
rel_path = relpath(cfg.in_dir, full_path)
+ # Allow paths to be specified in exclude_files:
+ for e in cfg.exclude_files:
+ if fnmatch.fnmatch(rel_path, e):
+ log("ignoring file %s" % rel_path, level=7)
+ ok = False
+ break
+ if ok:
log("reading file %s" % rel_path, level=5)
file = File(
path = full_path,