changeset 16:985b3a7e0e88

add formatters to include css and genshi templates
author k0s <k0scist@gmail.com>
date Fri, 25 Dec 2009 18:57:56 -0500
parents 8923fda80bd4
children eab191e0b9b3
files decoupage/formatters.py setup.py
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/decoupage/formatters.py	Fri Dec 25 18:26:24 2009 -0500
+++ b/decoupage/formatters.py	Fri Dec 25 18:57:56 2009 -0500
@@ -107,6 +107,22 @@
                 f['title'] = f['description']
                 f['description'] = None
 
+class CSS(object):
+    """specify CSS"""
+
+    def __init__(self, arg):
+        self.css = arg.split()
+    def __call__(self, request, data):
+        data['stylesheets'] = self.css
+
+class Include(object):
+    """include a file at the top of the body"""
+
+    def __init__(self, arg):
+        self.include = arg
+    def __call__(self, request, data):
+        data['include'] = self.include
+
         
 def formatters():
     formatters = {}
--- a/setup.py	Fri Dec 25 18:26:24 2009 -0500
+++ b/setup.py	Fri Dec 25 18:57:56 2009 -0500
@@ -6,7 +6,7 @@
 except IOError:
     description = ''
 
-version = '0.3.5'
+version = '0.4'
 
 setup(name='decoupage',
       version=version,
@@ -38,8 +38,10 @@
       main = decoupage.factory:factory
 
       [decoupage.formatters]
+      all = decoupage.formatters:All
+      css = decoupage.formatters:CSS
       ignore = decoupage.formatters:Ignore
-      all = decoupage.formatters:All
+      include = decoupage.formatters:Include
       describe = decoupage.formatters:FilenameDescription
       title = decoupage.formatters:TitleDescription
       """,