incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1294170 - /incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py
Date Mon, 27 Feb 2012 14:52:45 GMT
Author: gjm
Date: Mon Feb 27 14:52:45 2012
New Revision: 1294170

URL: http://svn.apache.org/viewvc?rev=1294170&view=rev
Log:
adding template providing powers to the multiproduct plugin

Modified:
    incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py

Modified: incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py?rev=1294170&r1=1294169&r2=1294170&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py (original)
+++ incubator/bloodhound/trunk/bloodhound_multiproduct/multiproduct/model.py Mon Feb 27 14:52:45
2012
@@ -17,10 +17,12 @@
 #  under the License.
 
 """Models to support multi-product"""
+from pkg_resources import resource_filename
 from trac.core import Component, TracError, implements
 from trac.resource import ResourceNotFound
 from trac.db import Table, Column, DatabaseManager
 from trac.env import IEnvironmentSetupParticipant
+from trac.web.chrome import ITemplateProvider
 from trac.resource import Resource
 
 DB_VERSION = 1
@@ -245,9 +247,9 @@ class ProductResourceMap(ModelBase):
         self.update()
 
 class MultiProductEnvironmentProvider(Component):
-    """Provides the means to create the db tables"""
+    """Creates the database tables and template directories"""
     
-    implements(IEnvironmentSetupParticipant)
+    implements(IEnvironmentSetupParticipant, ITemplateProvider)
     
     SCHEMA = [
         Table('bloodhound_product', key = 'prefix') [
@@ -308,4 +310,13 @@ class MultiProductEnvironmentProvider(Co
                     for statement in db_connector.to_sql(table):
                         db(statement)
                 db_installed_version = self.get_version()
+    
+    # ITemplateProvider methods
+    def get_templates_dirs(self):
+        """provide the plugin templates"""
+        return [resource_filename(__name__, 'templates')]
+    
+    def get_htdocs_dirs(self):
+        """proved the plugin htdocs"""
+        return []
 



Mime
View raw message