[zpkg] SVN: zpkgtools/trunk/zpkgtools/locationmap.py actually
support printing the line number there when a duplicate
Philipp von Weitershausen
philikon at philikon.de
Tue Nov 1 09:54:00 EST 2005
Log message for revision 39811:
actually support printing the line number there when a duplicate
entry is found.
Changed:
U zpkgtools/trunk/zpkgtools/locationmap.py
-=-
Modified: zpkgtools/trunk/zpkgtools/locationmap.py
===================================================================
--- zpkgtools/trunk/zpkgtools/locationmap.py 2005-11-01 14:52:39 UTC (rev 39810)
+++ zpkgtools/trunk/zpkgtools/locationmap.py 2005-11-01 14:53:59 UTC (rev 39811)
@@ -174,7 +174,7 @@
except ValueError:
self.cvsbase = None
- def add(self, resource, url):
+ def add(self, resource, url, lineno='<unknown>'):
urlparts = url.split()
if len(urlparts) != 1:
raise MapLoadingError("malformed package specification",
@@ -188,8 +188,8 @@
if resource in self.local_entries:
_logger.warn(
- "found duplicate entry for resource %r in %s at line %d",
- resource, self.filename)
+ "found duplicate entry for resource %r in %s at line %s",
+ resource, self.filename, lineno)
elif resource.endswith(".*"):
# Deal with wildcarded resources;
# need to check if it's already there
@@ -240,7 +240,8 @@
raise MapLoadingError("malformed package specification",
filename, lineno)
try:
- maploader.add(*parts)
+ kw = dict(lineno=lineno)
+ maploader.add(*parts, **kw)
except MapLoadingError, e:
e.lineno = lineno
raise
More information about the zpkg
mailing list