From 7b8ddd1be9789e3e1a72f48f64356656b341956b Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 31 Dec 2011 11:02:05 +0100 Subject: tracking: Output proper message on status when no packages are registered. --- modules/tracking.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') 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 -- cgit v1.2.3