Changes between Version 13 and Version 14 of EggCookingTutorial/AdvancedEggCooking


Ignore:
Timestamp:
Jun 14, 2006, 7:35:00 PM (9 years ago)
Author:
maxb
Comment:

Update ITemplateProvider.get_templates_dirs docstring, and move the added package_data argument to setup.py's setup() to the end. Also, sync my recent change to previous tutorial step.

Legend:

Unmodified
Added
Removed
Modified
  • EggCookingTutorial/AdvancedEggCooking

    v13 v14  
    7070    # ITemplateProvider methods
    7171    def get_templates_dirs(self):
     72        """Return a list of directories containing the provided ClearSilver
     73        templates.
    7274        """
    73         Return the absolute path of the directory containing the provided
    74         ClearSilver templates.
    75         """
     75
    7676        from pkg_resources import resource_filename
    7777        return [resource_filename(__name__, 'templates')]
     
    9090class UserbaseModule(Component):
    9191    implements(INavigationContributor, IRequestHandler, ITemplateProvider)
    92        
     92
    9393    # INavigationContributor methods
    9494    def get_active_navigation_item(self, req):
    9595        return 'helloworld'
    96                
     96
    9797    def get_navigation_items(self, req):
    98         yield 'mainnav', 'helloworld', Markup('<a href="%s">Hello</a>', self.env.href.helloworld())
    99        
     98        yield 'mainnav', 'helloworld', Markup('<a href="%s">Hello</a>',
     99                self.env.href.helloworld())
     100
    100101    # IRequestHandler methods
    101102    def match_request(self, req):
    102103        return req.path_info == '/helloworld'
    103                                        
     104
    104105    def process_request(self, req):
    105106        return 'helloworld.cs', None
    106                
     107
    107108    # ITemplateProvider methods
    108109    def get_templates_dirs(self):
     110        """Return a list of directories containing the provided ClearSilver
     111        templates.
    109112        """
    110         Return the absolute path of the directory containing the provided
    111         ClearSilver templates.
    112         """
     113
    113114        from pkg_resources import resource_filename
    114115        return [resource_filename(__name__, 'templates')]
     
    130131      version=VERSION,
    131132      packages=['helloworld'],
    132       package_data={'helloworld' : ['templates/*.cs']},
    133133      entry_points={'trac.plugins': '%s = helloworld' % PACKAGE},
     134      package_data={'helloworld': ['templates/*.cs']},
    134135)
    135136}}}