caslib/cas.py | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
New commits:
commit 6c0e4d36525e5ec03794208f8deed2c4060f5e1d
Author: adam stokes <astokes(a)fedoraproject.org>
Date: Wed May 5 12:25:11 2010 -0400
fix tracebacks
diff --git a/caslib/cas.py b/caslib/cas.py
index 3dd57ac..210a562 100755
--- a/caslib/cas.py
+++ b/caslib/cas.py
@@ -80,17 +80,18 @@ if config.has_option("advanced", "buffersize"):
def coreHandler(uri, dst):
dst = os.path.join(dst, os.path.basename(uri))
try:
- grabber.urlgrab(uri, dst)
+ grabber.urlgrab(uri)
except grabber.URLGrabError, e:
genprint(e)
- genprint("Detected a compressed core, extracting.." \
- "please wait as this process can take a " \
- "long time.")
+ shutil.move(uri, dst)
if not coreIsCorefile(dst):
os.chdir(os.path.dirname(dst))
+ genprint("Detected a compressed core, extracting.." \
+ "please wait as this process can take a " \
+ "long time.")
corepath = coreExtract(dst)
if not corepath:
- return _e[3]
+ raise SystemExit(_e[3])
else:
return corepath
else:
@@ -147,7 +148,11 @@ class CasApplication(object):
if not self.opts.filename:
parser.error("A file object is missing.")
else:
- self.filename = self.opts.filename
+ if os.path.isfile(self.opts.filename):
+ self.filename = self.opts.filename
+ else:
+ raise SystemExit(genprint("%s : %s" % (_e[7],
+ self.opts.filename)))
# check if we want to strip the core
if self.opts.strip_core:
Show replies by date