diff piecrust/processing/tree.py @ 117:6827dcc9d3fb

Changes to the asset processing pipeline: * Add semi-functional RequireJS processor. * Processors now match on the relative path. * Support for processors that add more processors of their own. * A couple of related fixes.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 28 Oct 2014 08:20:38 -0700
parents 45828c4167ad
children 133845647083
line wrap: on
line diff
--- a/piecrust/processing/tree.py	Mon Oct 27 08:18:12 2014 -0700
+++ b/piecrust/processing/tree.py	Tue Oct 28 08:20:38 2014 -0700
@@ -34,9 +34,8 @@
 
     def getProcessor(self):
         if self._processor is None:
-            _, filename = os.path.split(self.path)
             for p in self.available_procs:
-                if p.matches(filename):
+                if p.matches(self.path):
                     self._processor = p
                     self.available_procs.remove(p)
                     break
@@ -85,7 +84,7 @@
             # If the root tree node (and only that one) wants to bypass this
             # whole tree business, so be it.
             if proc.is_bypassing_structured_processing:
-                if proc != tree_root:
+                if cur_node != tree_root:
                     raise ProcessingTreeError("Only root processors can "
                             "bypass structured processing.")
                 break
@@ -145,7 +144,10 @@
             try:
                 start_time = time.clock()
                 proc.process(full_path, self.out_dir)
-                print_node(format_timed(start_time, "(bypassing structured processing)"))
+                print_node(
+                        node,
+                        format_timed(
+                            start_time, "(bypassing structured processing)"))
                 return True
             except Exception as e:
                 raise Exception("Error processing: %s" % node.path) from e