[Zope-CVS] CVS: Products/Basket - __init__.py:1.5 utils.py:1.4
Chris McDonough
chrism at plope.com
Mon Nov 7 16:48:09 EST 2005
Update of /cvs-repository/Products/Basket
In directory cvs.zope.org:/tmp/cvs-serv14395
Modified Files:
__init__.py utils.py
Log Message:
Accept and pass in the proper args to EggProductContext.
=== Products/Basket/__init__.py 1.4 => 1.5 ===
--- Products/Basket/__init__.py:1.4 Mon Nov 7 16:29:11 2005
+++ Products/Basket/__init__.py Mon Nov 7 16:48:08 2005
@@ -40,6 +40,8 @@
return data
def product_distributions_by_dwim(self):
+ """ Find all product distributions which have an appropriate
+ entry point group on sys.path """
environment = pkg_resources.Environment()
ns_meta = 'entry_points.txt'
product_distros = []
=== Products/Basket/utils.py 1.3 => 1.4 ===
--- Products/Basket/utils.py:1.3 Mon Nov 7 15:11:02 2005
+++ Products/Basket/utils.py Mon Nov 7 16:48:08 2005
@@ -155,27 +155,26 @@
def __init__(self, app, package):
self.app = app
self.package = package
- self.product = None
+ self.createProductObject()
def createProductObject(self):
- # Create a persisten object in the ControlPanel.Products area
- # represeing a product packaged as an egg and set it as self.product
+ # Create a persistent object in the ControlPanel.Products area
+ # representing a product packaged as an egg and set it as self.product
products = self.app.Control_Panel.Products
fver = ''
-
+ packagename = self.package.__name___
+ productname = packagename.split('.')[-1]
if hasattr(self.package, '__import_error__'):
ie = self.package.__import_error__
else:
ie = None
- productname = self.product.__name__
-
# Retrieve version number from any suitable version.txt
for fname in ('version.txt', 'VERSION.txt', 'VERSION.TXT'):
- if pkg_resources.resource_exists(productname, fname):
- fver = pkg_resources.resource_string(productname, fname)
+ if pkg_resources.resource_exists(packagename, fname):
+ fver = pkg_resources.resource_string(packagename, fname)
break
old=None
More information about the Zope-CVS
mailing list