bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1456923 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_theme/bhtheme/theme.py
Date Fri, 15 Mar 2013 12:20:15 GMT
Author: jure
Date: Fri Mar 15 12:20:15 2013
New Revision: 1456923

URL: http://svn.apache.org/r1456923
Log:
Removed ProductEnvironmentFactory, not needed after #440


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/env.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/hooks.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/env.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/env.py?rev=1456923&r1=1456922&r2=1456923&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/env.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/env.py
Fri Mar 15 12:20:15 2013
@@ -127,7 +127,7 @@ class Environment(trac.env.Environment):
         return ProductEnvContextManager(super(Environment, self).db_transaction)
 
     def _all_product_envs(self):
-        return [ProductEnvironmentFactory(self, product) for product in Product.select(self)]
+        return [ProductEnvironment(self, product) for product in Product.select(self)]
 
     def needs_upgrade(self):
         """Return whether the environment needs to be upgraded."""
@@ -850,7 +850,7 @@ class ProductEnvironment(Component, Comp
             return env
         if prefix:
             try:
-                return ProductEnvironmentFactory(global_env, prefix)
+                return ProductEnvironment(global_env, prefix)
             except LookupError:
                 if not name:
                     raise
@@ -858,7 +858,7 @@ class ProductEnvironment(Component, Comp
             # Lookup product by name
             products = Product.select(global_env, where={'name' : name})
             if products:
-                return ProductEnvironmentFactory(global_env, products[0])
+                return ProductEnvironment(global_env, products[0])
             else:
                 raise LookupError("Missing product '%s'" % (name,))
         else:
@@ -884,5 +884,3 @@ class ProductEnvironment(Component, Comp
 
 lookup_product_env = ProductEnvironment.lookup_env
 resolve_product_href = ProductEnvironment.resolve_href
-
-ProductEnvironmentFactory = ProductEnvironment

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/hooks.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/hooks.py?rev=1456923&r1=1456922&r2=1456923&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/hooks.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/hooks.py
Fri Mar 15 12:20:15 2013
@@ -45,7 +45,7 @@ class MultiProductEnvironmentFactory(Env
                 # happen from within trac.web.main.dispatch_request
                 req = RequestWithSession(environ, None)
                 global_env._abs_href = req.abs_href
-            env = multiproduct.env.ProductEnvironmentFactory(global_env, pid)
+            env = multiproduct.env.ProductEnvironment(global_env, pid)
         return env
 
 class ProductizedHref(Href):
@@ -84,12 +84,12 @@ class ProductRequestWithSession(RequestW
 
     def product_perm(self, product, resource=None):
         """Helper for per product permissions"""
-        from multiproduct.env import Environment, ProductEnvironment, ProductEnvironmentFactory
+        from multiproduct.env import Environment, ProductEnvironment
         if isinstance(self.perm.env, Environment):
-            return PermissionCache(ProductEnvironmentFactory(self.perm.env, product),
+            return PermissionCache(ProductEnvironment(self.perm.env, product),
                                    username=self.authname, resource=resource)
         elif isinstance(self.perm.env, ProductEnvironment):
-            return PermissionCache(ProductEnvironmentFactory(self.perm.env.parent, product),
+            return PermissionCache(ProductEnvironment(self.perm.env.parent, product),
                                    username=self.authname, resource=resource)
         else:
             raise TracError("Internal error, product permissions evaluated on invalid environment.")

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py?rev=1456923&r1=1456922&r2=1456923&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_theme/bhtheme/theme.py
Fri Mar 15 12:20:15 2013
@@ -51,7 +51,7 @@ from urlparse import urlparse
 from wsgiref.util import setup_testing_defaults
 
 from multiproduct.model import Product
-from multiproduct.env import ProductEnvironment, ProductEnvironmentFactory
+from multiproduct.env import ProductEnvironment
 from multiproduct.web_ui import PRODUCT_RE
 
 try:



Mime
View raw message