Commits

Jan-Jaap Driessen committed c7d966e

include the _mode in calculation of the relpath.

  • Participants
  • Parent commits 1c5e23e
  • Branches compilers-n-minifiers2

Comments (0)

Files changed (1)

File fanstatic/core.py

             if minified is not None or debug is not None:
                 raise ConfigurationError('Cannot set minified or debug version of compile Resource.')
 
-            # YYY move?
+            # XXX move?
             # Calculate relpath based on the source extension + compiler
-            self.relpath = self.compiler.target_path(self.source)
+            self.relpath = self.compiler.target_path(self.source, mode=self._mode)
 
             if self.library.devmode:
                 # In devmode, the compiler should be available.
                     # XXX Should be a part of the Resource instantiation, not here.
                     if not os.path.exists(target_fullpath):
                         raise ProcessedResourceNotFoundError("Minified file for %s does not exist: %s" % (self, target_fullpath))
-            elif self.compiler is not None and self.compiler.minified:
-                # If a compiler was found and it exposes minifying behavior, 
-                # use the compiler.
-                self.relpath = self.compiler.target_path(self.relpath, mode=self._mode)
-
-        if self._mode == DEBUG:
-            if self.compiler is not None and self.compiler.debug:
-                self.relpath = self.compiler.target_path(self.relpath, mode=self._mode)
 
         self.modes = {}