[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - app.py:1.58
Fred L. Drake, Jr.
fred at zope.com
Fri May 7 16:47:28 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv14559
Modified Files:
app.py
Log Message:
turn errors in loading and validating a component into a simple user
error; no need to dump a traceback for this
=== Packages/zpkgtools/zpkgtools/app.py 1.57 => 1.58 ===
--- Packages/zpkgtools/zpkgtools/app.py:1.57 Fri May 7 14:08:57 2004
+++ Packages/zpkgtools/zpkgtools/app.py Fri May 7 16:47:27 2004
@@ -99,7 +99,7 @@
This method does everything needed to knit a distribution
together; it should be refactored substantially.
"""
- top = Component(self.resource, self.resource_url, self.ip)
+ top = self.get_component(self.resource, self.resource_url)
top.write_package(self.destination)
handled = sets.Set()
required = top.get_dependencies()
@@ -120,7 +120,7 @@
location = self.locations[resource]
self.logger.debug("loading resource %r from %s",
resource, location)
- component = Component(resource, location, self.ip)
+ component = self.get_component(resource, location)
if first:
os.mkdir(depsdir)
first = False
@@ -142,6 +142,12 @@
top.write_setup_py(version=self.options.version)
top.write_setup_cfg()
top.write_manifest()
+
+ def get_component(self, resource, location):
+ try:
+ return Component(resource, location, self.ip)
+ except zpkgtools.Error, e:
+ self.error(str(e), rc=1)
def add_headers(self, component):
pkginfo = component.get_package_info()
More information about the Zope-CVS
mailing list