]> oss.titaniummirror.com Git - webber.git/blobdiff - webber.py
Remove lots of documentation typos.
[webber.git] / webber.py
index 22e18428a1c587ef0f9515b7c06c2db51f8dd811..8d73f11c456f1679de1b04667b92147c6abd698a 100644 (file)
--- a/webber.py
+++ b/webber.py
@@ -445,12 +445,14 @@ def iso_to_time(val):
        return int(time.mktime(t))
 
 @set_function("format_date")
-def format_date(timestamp):
-       return time.strftime(cfg.date_format, time.localtime(timestamp))
+def format_date(timestamp, format=None):
+       if not format:
+               format = cfg.date_format
+       return time.strftime(format, time.localtime(timestamp))
 
 @set_function("get_time")
-def get_time():
-       return format_date(time.time())
+def get_time(format=None):
+       return format_date(time.time(), format)
 
 @set_function("get_current_file")
 def get_current_file():
@@ -519,7 +521,7 @@ def walk_tree(dirpath):
                        full_path = os.path.join(dirpath, s)
                        ok = True
                        if os.path.isdir(full_path):
-                               for e in cfg.exclude_dir:
+                               for e in cfg.exclude_dirs:
                                        if fnmatch.fnmatchcase(s, e):
                                                log("ignoring directory %s" % s, level=7)
                                                ok = False
@@ -777,7 +779,12 @@ def main():
        # link contents of webber.ini into cfg and set some defaults,
        # then let plugins fixup things in cfg.*
        cfg.inheritFrom(options)
-       cfg.setDefault("exclude_dir", ["plugins"])
+       cfg.setDefault("exclude_dirs", [])
+       cfg.setDefault("exclude_files", ["webber.conf", "directory.conf", "*.tmpl"])
+       cfg.setDefault("copy_files", [])
+       cfg.setDefault("input_encoding", "iso-8859-1")
+       cfg.setDefault("output_encoding", "iso-8859-1")
+       cfg.setDefault("template", "default")
        run_hooks("checkconfig")
 
        run_hooks("start")