changeset 61:f5ca54558292

remove previous hacks
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 25 Nov 2010 12:06:40 -0800
parents cf18ea0313f9
children 0890ec7069f3
files decoupage/web.py setup.py
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/decoupage/web.py
+++ b/decoupage/web.py
@@ -15,17 +15,17 @@ from genshi.template.base import Templat
 from genshi.template.base import TemplateSyntaxError
 from martini.config import ConfigMunger
 from paste.fileapp import FileApp
 from pkg_resources import iter_entry_points
 from pkg_resources import load_entry_point
 from pkg_resources import resource_filename
 from webob import Request, Response, exc
 
-transformers = [i.lower() for i in transformers()]
+transformers = transformers()
 
 class Decoupage(object):
 
     ### class level variables
     defaults = { 'auto_reload': 'False',
                  'configuration': None,
                  'directory': None, # directory to serve
                  'cascade': 'True', # whether to cascade configuration
@@ -46,17 +46,17 @@ class Decoupage(object):
         self.directory = self.directory.rstrip(os.path.sep)
         assert os.path.isdir(self.directory)
         self.template_directories = self.template_directories.split() # no spaces in directory names, for now
 
         for directory in self.template_directories:
             assert os.path.isdir(directory), "Decoupage template directory %s does not exist!" % directory
 
         # static file server
-        self.fileserver = FileApp # XXX still used?!?
+        self.fileserver = FileApp
 
         # pluggable formats
         s = 'decoupage.format.'
         _format_args = [ (i.split(s, 1)[-1], j) for i, j in app_conf.items()
                          if i.startswith(s) ]
         format_args = {}
         for i, j in _format_args:
             assert i.count('.') == 1, 'Illegal string or something'
@@ -110,22 +110,22 @@ class Decoupage(object):
                 return res(environ, start_response)
             else:
                 conf = self.conf(request.path_info.rsplit('/',1)[0])
                 if '/transformer' in conf:
                     args = [i.split('=', 1) for i in conf['/transformer'].split(',') if '=' in i]
                     kwargs = {}
                     for i in conf:
                         if i.startswith('/'):
-                            name = i[1:].lower()
+                            name = i[1:]
                             if name in transformers:
                                 kwargs[name] = dict([j.split('=', 1) for j in conf[i].split(',') if '=' in j])
                     fileserver = FileTypeTransformer(*args, **kwargs)
                 else:
-                    fileserver = FileApp
+                    fileserver = self.fileserver
                     
                 fileserver = fileserver(path)
                 return fileserver(environ, start_response)
         else:
             raise exc.HTTPNotFound()
 
 
     def get(self, request):
@@ -244,17 +244,17 @@ class Decoupage(object):
             if i in filenames or i.startswith('/'):
                 continue
             if i.startswith('http://') or i.startswith('https://'):
                 files.append({'path': i,
                               'name': i,
                               'type': link})
             
         for f in files:
-            f['description'] = conf.get(f['name'].lower(), None)
+            f['description'] = conf.get(f['name'], None)
 
         return files
 
     def conf(self, path, cascade=None):
         """returns configuration dictionary appropriate to a path"""
         if cascade is None:
             cascase = self.cascade
 
--- a/setup.py
+++ b/setup.py
@@ -1,17 +1,17 @@
 from setuptools import setup, find_packages
 
 # use README as long_description
 try:
     description = file("README.txt").read()
 except IOError:
     description = ''
 
-version = '0.10.0'
+version = '0.10.1'
 
 setup(name='decoupage',
       version=version,
       description="Decoupage is the art of decorating an object by gluing colored paper cutouts onto it in combination with special paint effects ... The software decoupage lets you stitch together index pages from filesystem content",
       long_description=description,
       classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
       author='Jeff Hammel',
       author_email='k0scist@gmail.com',
@@ -21,18 +21,18 @@ setup(name='decoupage',
       include_package_data=True,
       zip_safe=False,
       install_requires=[
           # -*- Extra requirements: -*-
           'WebOb',	
           'Paste',
           'PasteScript',
           'genshi',
-          'martINI',
-          'contenttransformer',
+          'martINI>=0.4',
+          'contenttransformer>=0.3.3',
           'PyRSS2Gen',
          ],
       dependency_links=['http://www.dalkescientific.com/Python/PyRSS2Gen-1.0.0.tar.gz#egg=PyRSS2Gen'],
       entry_points="""
       # -*- Entry points: -*-
       [console_scripts]
       decoupage-templates = decoupage.templates:main
       decoupage-formatters = decoupage.formatters:main