X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=webber.py;h=542df6da3172ac4eba2090b38d854ca28a54b1a1;hb=1daef34f3ca3bac644fcb4d5ef15055f48d355b6;hp=5cadaaff6c9736eefc0bc0b52224230972551de2;hpb=b6516c2f008de488b945f455b507f8134db4b47b;p=webber.git diff --git a/webber.py b/webber.py index 5cadaaf..542df6d 100644 --- a/webber.py +++ b/webber.py @@ -63,6 +63,7 @@ class File(Holder): Holder.__init__(self, **kw) files[kw["rel_path"]] = self self.render = None + self.contents = None mtime = os.stat(self.path)[stat.ST_MTIME] self.mtime = mtime self.ctime = mtime @@ -80,7 +81,7 @@ class File(Holder): if read_keywords: s = s.strip() #print "kwd:", s - if s==terminate_line: + if s == terminate_line: read_keywords = False continue @@ -261,7 +262,7 @@ def get_program_directory(): # 5... Debug # def log(s, level=4): - if level>4: + if level > 4: indent = " " * (level-4) else: indent = "" @@ -434,7 +435,7 @@ def iso_to_time(val): try: t = time.strptime(val, "%Y-%m-%d") except ValueError: - warning("%s: wrong ISO format in '%s'" % (self.rel_path, s)) + warning("wrong ISO format in '%s'" % val) return int(time.mktime(t)) @set_function("format_date") @@ -608,11 +609,13 @@ def scan_files(): for s in files: file = files[s] - try: - # Just check if the file has contents - contents = file.contents - except: + if not file.has_key("contents"): continue +# try: +# # Just check if the file has contents +# contents = file.contents +# except: +# continue direc = directories[file.direc]