Changes between Version 13 and Version 14 of EggCookingTutorial/AdvancedEggCooking
- Timestamp:
- Jun 14, 2006, 5:35:00 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EggCookingTutorial/AdvancedEggCooking
v13 v14 70 70 # ITemplateProvider methods 71 71 def get_templates_dirs(self): 72 """Return a list of directories containing the provided ClearSilver 73 templates. 72 74 """ 73 Return the absolute path of the directory containing the provided 74 ClearSilver templates. 75 """ 75 76 76 from pkg_resources import resource_filename 77 77 return [resource_filename(__name__, 'templates')] … … 90 90 class UserbaseModule(Component): 91 91 implements(INavigationContributor, IRequestHandler, ITemplateProvider) 92 92 93 93 # INavigationContributor methods 94 94 def get_active_navigation_item(self, req): 95 95 return 'helloworld' 96 96 97 97 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 100 101 # IRequestHandler methods 101 102 def match_request(self, req): 102 103 return req.path_info == '/helloworld' 103 104 104 105 def process_request(self, req): 105 106 return 'helloworld.cs', None 106 107 107 108 # ITemplateProvider methods 108 109 def get_templates_dirs(self): 110 """Return a list of directories containing the provided ClearSilver 111 templates. 109 112 """ 110 Return the absolute path of the directory containing the provided 111 ClearSilver templates. 112 """ 113 113 114 from pkg_resources import resource_filename 114 115 return [resource_filename(__name__, 'templates')] … … 130 131 version=VERSION, 131 132 packages=['helloworld'], 132 package_data={'helloworld' : ['templates/*.cs']},133 133 entry_points={'trac.plugins': '%s = helloworld' % PACKAGE}, 134 package_data={'helloworld': ['templates/*.cs']}, 134 135 ) 135 136 }}}