]> oss.titaniummirror.com Git - webber.git/blobdiff - webber.py
doc: added tutorial
[webber.git] / webber.py
index c40fcee68226de47127f7d11b3253f92194e468e..687e182fa89b93b70bf5c96e5606d2b52144e9ef 100644 (file)
--- a/webber.py
+++ b/webber.py
@@ -50,7 +50,15 @@ class Directory(Holder):
 
        def __init__(self, **kw):
                Holder.__init__(self, **kw)
-               directories[kw["rel_path"]] = self
+               kw["rel_path"] = self
+               if self.rel_path == "":
+                       self.rel_path = "."
+               directories[self.rel_path] = self
+               try:
+                       self.load(os.path.join(self.abs_path, "directory.conf"))
+                       #print self
+               except IOError:
+                       pass
 
 
 files = {}
@@ -511,7 +519,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
@@ -769,7 +777,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")