* Amarok plays Killing me softly by Fugees.

When these things catches KeyboardInterrupts they eat
and spit it.
This commit is contained in:
Faik Uygur
2006-10-23 18:25:07 +00:00
parent 83e9549616
commit a4074c8db4
7 changed files with 27 additions and 9 deletions
+3 -1
View File
@@ -497,7 +497,9 @@ def rebuild_db(files=False):
# check db schema versions # check db schema versions
try: try:
pisi.lockeddbshelve.check_dbversion('filesdbversion', pisi.__filesdbversion__, write=False) pisi.lockeddbshelve.check_dbversion('filesdbversion', pisi.__filesdbversion__, write=False)
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
files = True # exception means the files db version was wrong files = True # exception means the files db version was wrong
pisi.lockeddbshelve.init_dbenv(write=True, writeversion=True) pisi.lockeddbshelve.init_dbenv(write=True, writeversion=True)
destroy(files) # bye bye destroy(files) # bye bye
+3 -1
View File
@@ -50,7 +50,9 @@ def wait_comar():
else: else:
sock.connect("/var/run/comar.socket") sock.connect("/var/run/comar.socket")
return True return True
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
timeout -= 0.2 timeout -= 0.2
time.sleep(0.2) time.sleep(0.2)
return False return False
+3 -1
View File
@@ -203,7 +203,9 @@ class Fetcher:
try: try:
total_size = int(headers['Content-Length']) + self.exist_size total_size = int(headers['Content-Length']) + self.exist_size
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
total_size = 0 total_size = 0
self._do_grab(fileObj, dest, total_size) self._do_grab(fileObj, dest, total_size)
+3 -1
View File
@@ -210,7 +210,9 @@ class File:
if sign==File.detached: if sign==File.detached:
try: try:
sigfilename = File.download(URI(uri + '.sig'), transfer_dir) sigfilename = File.download(URI(uri + '.sig'), transfer_dir)
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
raise NoSignatureFound(uri) raise NoSignatureFound(uri)
if os.system('gpg --verify ' + sigfilename) != 0: if os.system('gpg --verify ' + sigfilename) != 0:
raise InvalidSignature(uri) raise InvalidSignature(uri)
+3 -1
View File
@@ -266,7 +266,9 @@ def is_upgradable(name, ignore_build = False):
(version, release, build) = ctx.installdb.get_version(name) (version, release, build) = ctx.installdb.get_version(name)
try: try:
pkg = ctx.packagedb.get_package(name) pkg = ctx.packagedb.get_package(name)
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
return False return False
if ignore_build or (not build) or (not pkg.build): if ignore_build or (not build) or (not pkg.build):
return Version(release) < Version(pkg.release) return Version(release) < Version(pkg.release)
+9 -3
View File
@@ -106,7 +106,9 @@ class LocalText(dict):
return 'en' return 'en'
else: else:
return lang[0:2] return lang[0:2]
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
raise Error(_('LocalText: unable to get either current or default locale')) raise Error(_('LocalText: unable to get either current or default locale'))
def errors(self, where = unicode()): def errors(self, where = unicode()):
@@ -403,7 +405,9 @@ class autoxml(oo.autosuper, oo.autoprop):
try: try:
if getattr(self, name) != getattr(other, name): if getattr(self, name) != getattr(other, name):
return False return False
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
return False return False
return True return True
def notequal(self, other): def notequal(self, other):
@@ -640,7 +644,9 @@ class autoxml(oo.autosuper, oo.autoprop):
if text: if text:
try: try:
value = autoxml.basic_cons_map[token_type](text) value = autoxml.basic_cons_map[token_type](text)
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
value = None value = None
errs.append(where + ': ' + _('Type mismatch: read text cannot be decoded')) errs.append(where + ': ' + _('Type mismatch: read text cannot be decoded'))
return value return value
+3 -1
View File
@@ -458,7 +458,9 @@ def sha1_data(data):
m = sha.new() m = sha.new()
m.update(data) m.update(data)
return m.hexdigest() return m.hexdigest()
except: except KeyboardInterrupt:
raise
except Exception, e: #FIXME: what exception could we catch here, replace with that.
raise Error(_("Cannot calculate SHA1 hash of given data")) raise Error(_("Cannot calculate SHA1 hash of given data"))
def uncompress(patchFile, compressType="gz", targetDir=None): def uncompress(patchFile, compressType="gz", targetDir=None):