comparison decoupage/web.py @ 33:e384d4569ac3

include components necessary to make decoupage feel almost like a framework
author k0s <k0scist@gmail.com>
date Mon, 08 Feb 2010 11:40:57 -0500
parents f306089d6def
children 527ccb76d043
comparison
equal deleted inserted replaced
32:983c13e1b71f 33:e384d4569ac3
1 """ 1 """
2 decoupage: a view with webob 2 decoupage: a view with webob to index and serve static content
3 """ 3 """
4 4
5 import os 5 import os
6 6
7 from contenttransformer.app import FileTypeTransformer 7 from contenttransformer.app import FileTypeTransformer
100 path = '/%s' % path 100 path = '/%s' % path
101 101
102 # get the configuraton 102 # get the configuraton
103 conf = self.conf(path) 103 conf = self.conf(path)
104 104
105 # build data dictionary 105 ### build data dictionary
106 files = self.filedata(path, directory, conf) 106 files = self.filedata(path, directory, conf)
107 data = {'path': path, 'files': files, 'request': request } 107 data = {'path': path, 'files': files, 'request': request }
108
109 # defaults; TODO: make this better
108 data['title'] = conf.get('/title') 110 data['title'] = conf.get('/title')
109 data['directory'] = directory 111 data['directory'] = directory
110 data['include'] = None 112 data['include'] = None
111 data['css'] = () 113 data['css'] = ()
114 data['scripts'] = ()
115 data['icon'] = None
112 116
113 # apply formatters 117 # apply formatters
114 # XXX this should be cached if not self.auto_reload 118 # XXX this should be cached if not self.auto_reload
115 if '/formatters' in conf: 119 if '/formatters' in conf:
116 # ordered list of formatters to be applied first 120 # ordered list of formatters to be applied first