1. fanstatic
  2. Untitled project
  3. fanstatic

Commits

Jan-Jaap Driessen  committed 6d37ab5 Merge

Merged in nilo/fanstatic (pull request #18)

correct documentation, change NONE to NOTHING

  • Participants
  • Parent commits f230b5a, 56f6589
  • Branches default

Comments (0)

Files changed (2)

File doc/compilers.rst

View file
   from fanstatic import Library, Resource
 
   coffee_library = Library('coffee', 'coffee_resources',
-                           compilers={'js': 'coffee'})
+                           compilers={'.js': 'coffee'})
 
   a = Resource(coffee_library, 'b.js')
   b = Resource(coffee_library, 'plain.js', compiler=None)
 
   from fanstatic import Library, Resource
 
-  js_library = Library('js', 'js_resources', minifiers={'js': 'jsmin'})
+  js_library = Library('js', 'js_resources', minifiers={'.js': 'jsmin'})
 
   a = Resource(js_library, 'a.js')
   b = Resource(js_library, 'tricky.js', minifier=None, minified='tricky.min.js')

File fanstatic/core.py

View file
     """
 
 
-NONE = object()
+NOTHING = object()
 
 
 class Resource(Renderable, Dependable):
                  debug=None,
                  dont_bundle=False,
                  minified=None,
-                 minifier=NONE,
-                 compiler=NONE,
+                 minifier=NOTHING,
+                 compiler=NOTHING,
                  source=None,
                  mode_parent=None):
         self.library = library
         self.ext = os.path.splitext(self.relpath)[1]
 
         self.mode_parent = mode_parent
-        if compiler is NONE:
+        if compiler is NOTHING:
             compiler = self.library.compilers.get(self.ext)
         self.compiler = fanstatic.registry.CompilerRegistry.instance()[
             compiler]
         self.source = source
 
-        if minifier is NONE:
+        if minifier is NOTHING:
             if mode_parent is None:
                 minifier = self.library.minifiers.get(self.ext)
             else: