]> oss.titaniummirror.com Git - webber.git/blobdiff - webber.py
toc.py: more comments
[webber.git] / webber.py
index d74302daa3a9f45b8b833d8472cefb3dd06b5f12..6be571e0ff09ea19d88e0e9e2ef6625b442eaf16 100644 (file)
--- a/webber.py
+++ b/webber.py
@@ -341,12 +341,7 @@ def load_plugins():
                for s in cfg.plugin_dirs:
                        sys.path.append(s)
        for s in cfg.plugins:
-               #print "import:", s
-               try:
-                       exec "import %s" % s
-               except:
-                       print "Could not import plugin '%s'" % s
-                       sys.exit(1)
+               exec "import %s" % s
 
 
 def set_hook(name, last=False):
@@ -622,6 +617,10 @@ def scan_files():
 
                direc = directories[file.direc]
 
+               # Output-Filename "berechnen"
+               if file.render and file.render == "html":
+                       file.out_path = os.path.splitext(s)[0] + ".html"
+
                run_hooks("scan",
                        direc=direc,
                        file=file)
@@ -667,9 +666,6 @@ def render_files():
                        continue
                file.contents = contents
 
-               # Output-Filename "berechnen"
-               file.out_path = os.path.splitext(fname_in)[0] + ".html"
-
        for fname_in in files:
                file = files[fname_in]
                current_file = file
@@ -678,14 +674,13 @@ def render_files():
                        continue
                direc = directories[file.direc]
 
-               contents = run_hooks("linkify",
+               run_hooks("linkify",
                        direc=direc,
                        file=file,
-                       return_holder=False)
+                       return_holder=True)
                #print "contents after 'linkify':", contents
-               if not contents:
+               if not file.contents:
                        continue
-               file.contents = contents
 
                # TODO: einige Fragmente sollen u.U. in eine andere
                # Webseite eingebaut werden und sollten daher nicht in