[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - app.py:1.55
Fred L. Drake, Jr.
fred at zope.com
Wed May 5 14:46:34 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv14571
Modified Files:
app.py
Log Message:
Component: cache the package info object so we only load it once
=== Packages/zpkgtools/zpkgtools/app.py 1.54 => 1.55 ===
--- Packages/zpkgtools/zpkgtools/app.py:1.54 Tue May 4 19:58:49 2004
+++ Packages/zpkgtools/zpkgtools/app.py Wed May 5 14:46:33 2004
@@ -281,6 +281,7 @@
self.ip = ip
self.dependencies = None
self.destination = None
+ self.pkginfo = None
self.pubinfo = None
self.source = self.ip.loader.load(self.url)
specs = include.load(self.source, url=self.url)
@@ -326,11 +327,15 @@
return self.dependencies
def get_package_info(self):
- destdir = os.path.join(self.destination, self.name)
- if self.is_python_package():
- return package.loadPackageInfo(self.name, destdir, self.name)
- else:
- return package.loadCollectionInfo(destdir, self.name)
+ if self.pkginfo is None:
+ destdir = os.path.join(self.destination, self.name)
+ if self.is_python_package():
+ pkginfo = package.loadPackageInfo(self.name, destdir,
+ self.name)
+ else:
+ pkginfo = package.loadCollectionInfo(destdir, self.name)
+ self.pkginfo = pkginfo
+ return self.pkginfo
def get_publication_info(self):
if self.pubinfo is None:
More information about the Zope-CVS
mailing list