Changeset 1680

Show
Ignore:
Timestamp:
12/13/06 05:40:23 (2 years ago)
Author:
coderanger
Message:

ThemeEnginePlugin:

Awesome admin system!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • themeengineplugin/0.10/setup.py

    r1678 r1680  
    88    version = '1.0', 
    99    packages = ['themeengine'], 
    10     package_data = { 'themeengine': [ 'templates/*.cs', 'templates/header/*.cs', 'templates/footer/*.cs', 'htdocs/*.css' ] }, 
     10    package_data = { 'themeengine': [ 'templates/*.cs', 'templates/header/*.cs', 'templates/footer/*.cs',  
     11                                      'htdocs/*.*', 'htdocs/img/*.*' ] }, 
    1112 
    1213    author = "Noah Kantrowitz", 
     
    2425    entry_points = { 
    2526        'trac.plugins': [ 
    26             'themeengine.api = themeengine.api', 
    2727            'themeengine.filter = themeengine.filter', 
     28            'themeengine.admin = themeengine.admin', 
    2829        ] 
    2930    } 
  • themeengineplugin/0.10/themeengine/api.py

    r1679 r1680  
    7272            
    7373 
    74 class NullTheme(ThemeBase): 
    75     """A default theme that does nothing.""" 
    76     pass 
  • themeengineplugin/0.10/themeengine/filter.py

    r1679 r1680  
    1313 
    1414 
    15 from api import IThemeProvider, NullTheme 
     15from api import IThemeProvider 
    1616 
    1717__all__ = ['ThemeFilterModule'] 
     
    8383    # IRequestHandler methods 
    8484    def match_request(self, req): 
    85         return req.path_info == '/themeengine/theme.css' 
     85        return req.path_info.startswith('/themeengine') 
    8686         
    8787    def process_request(self, req): 
    88         self._alter_loadpaths(req.hdf, self.theme['folders']) 
    89         return self.theme['css'], 'text/css' 
     88        path_info = req.path_info[12:] 
     89         
     90        if path_info == '/theme.css': 
     91            self._alter_loadpaths(req.hdf, self.theme['folders']) 
     92            return self.theme['css'], 'text/css' 
     93        elif path_info.startswith('/screenshot'): 
     94            name = path_info[12:] 
     95            if name in self.info and 'screenshot' in self.info[name]: 
     96                req.send_file(resource_filename(self.info[name]['module'], self.info[name]['screenshot'])) 
     97            else: 
     98                req.send_file(resource_filename(__name__, 'htdocs/default.png')) 
    9099 
    91100    # ITemplateProvider methods 
    92101    def get_templates_dirs(self): 
    93102        #from pkg_resources import resource_filename 
    94         #return [resource_filename(__name__, 'templates')] 
    95         return [] 
     103        return [resource_filename(__name__, 'templates')] 
     104        #return [] 
    96105         
    97106    def get_htdocs_dirs(self):