summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-12-31 11:02:05 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-12-31 11:02:05 +0100
commit7b8ddd1be9789e3e1a72f48f64356656b341956b (patch)
tree2099a815c307e6a9b32acdd0dc1a599de2e97282
parent03215467d467c429962822b90c5f95473389378a (diff)
tracking: Output proper message on status when no packages are registered.
-rw-r--r--modules/tracking.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 64db2b6..32d83a2 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -245,7 +245,7 @@ class Module:
if len(results):
msg = results
- else:
+ elif len(code):
try:
# type:code is handled by get_tracking_module()
tm = get_tracking_module(code)
@@ -255,10 +255,10 @@ class Module:
msg.append('\002%s\002 %s - %s' % (package.code, package.date, package.desc.decode('utf8')))
elif code:
msg = 'Failed to fetch tracking data for \002%s\002.' % code.decode('utf8')
- else:
- msg = 'No tracking number given or registered.'
except PackageError as e:
msg = str(e)
+ else:
+ msg = 'No tracking number given or registered.'
finally:
session.close()
return msg