* loosen the requirement on hashes for external symlinks

* cosmetics
This commit is contained in:
Eray Özkural
2005-10-12 10:56:38 +00:00
parent 21a8d87764
commit 6262939888
2 changed files with 17 additions and 12 deletions
+4 -4
View File
@@ -36,18 +36,18 @@ def handle_exception(exception, value, tb):
ui.error(unicode(value)) ui.error(unicode(value))
sys.exit(1) sys.exit(1)
elif isinstance(value, pisi.Error): elif isinstance(value, pisi.Error):
ui.error(_("Fatal Error.")) ui.error(_("\nFatal Error. Program Terminated."))
show_traceback = ctx.config.get_option('debug') show_traceback = ctx.config.get_option('debug')
elif isinstance(value, pisi.Exception): elif isinstance(value, pisi.Exception):
show_traceback = True show_traceback = True
ui.error(_(""" ui.error(_("""
Internal PISI Error. Please file a bug report. (http://bugs.uludag.org.tr) Unhandled internal exception.
""")) Please file a bug report. (http://bugs.uludag.org.tr)"""))
else: else:
# For any other exception (possibly Python exceptions) show # For any other exception (possibly Python exceptions) show
# the traceback! # the traceback!
show_traceback = ctx.config.get_option('debug') show_traceback = ctx.config.get_option('debug')
ui.error(_("System Error.")) ui.error(_("\nSystem Error. Program Terminated."))
ui.error("%s: %s\n" % (exception, value)) ui.error("%s: %s\n" % (exception, value))
+13 -8
View File
@@ -22,7 +22,7 @@ import pisi.lockeddbshelve as shelve
class FileInfo: class FileInfo:
"""FileInfo holds the information for a File node/tag in files.xml""" """FileInfo holds the information for a File node/tag in files.xml"""
def __init__(self, _path = "", _type = "", _size = "", _hash = ""): def __init__(self, _path = "", _type = "", _size = "", _hash = None):
self.path = _path self.path = _path
self.type = _type self.type = _type
self.size = _size self.size = _size
@@ -38,7 +38,11 @@ class FileInfo:
self.path = getNodeText(getNode(node, "Path")) self.path = getNodeText(getNode(node, "Path"))
self.type = getNodeText(getNode(node, "Type")) self.type = getNodeText(getNode(node, "Type"))
self.size = getNodeText(getNode(node, "Size")) self.size = getNodeText(getNode(node, "Size"))
self.hash = getNodeText(getNode(node, "SHA1Sum")) hashnode = getNode(node, "SHA1Sum")
if hashnode:
self.hash = getNodeText(hashnode)
else:
self.hash = None
def elt(self, dom): def elt(self, dom):
## FIXME: looking for a better way to do it ## FIXME: looking for a better way to do it
@@ -46,16 +50,17 @@ class FileInfo:
elt = dom.createElement("File") elt = dom.createElement("File")
pathElt = dom.createElement("Path") pathElt = dom.createElement("Path")
pathElt.appendChild(dom.createTextNode(self.path)) pathElt.appendChild(dom.createTextNode(self.path))
elt.appendChild(pathElt)
typeElt = dom.createElement("Type") typeElt = dom.createElement("Type")
typeElt.appendChild(dom.createTextNode(self.type)) typeElt.appendChild(dom.createTextNode(self.type))
elt.appendChild(typeElt)
sizeElt = dom.createElement("Size") sizeElt = dom.createElement("Size")
sizeElt.appendChild(dom.createTextNode(self.size)) sizeElt.appendChild(dom.createTextNode(self.size))
hashElt = dom.createElement("SHA1Sum")
hashElt.appendChild(dom.createTextNode(self.hash))
elt.appendChild(pathElt)
elt.appendChild(typeElt)
elt.appendChild(sizeElt) elt.appendChild(sizeElt)
elt.appendChild(hashElt) if self.hash:
hashElt = dom.createElement("SHA1Sum")
hashElt.appendChild(dom.createTextNode(self.hash))
elt.appendChild(hashElt)
return elt return elt
def has_errors(self): def has_errors(self):
@@ -63,7 +68,7 @@ class FileInfo:
err.has_tag(self.path, "File", "Path") err.has_tag(self.path, "File", "Path")
err.has_tag(self.type, "File", "Type") err.has_tag(self.type, "File", "Type")
err.has_tag(self.size, "File", "Size") err.has_tag(self.size, "File", "Size")
err.has_tag(self.hash, "File", "SHA1Sum") #err.has_tag(self.hash, "File", "SHA1Sum")
return err.list return err.list
def __str__(self): def __str__(self):