From dd95fca7fbae1211a7236b4418d0178b64f46d42 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 24 Jul 2012 20:50:45 +0200 Subject: tracking: Return URLs for all packages unless a tracking code is passed. --- modules/tracking.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/tracking.py b/modules/tracking.py index 3a11d7a..0e5ab5a 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -316,9 +316,6 @@ class Module: return msg def track_url(self, code, nick, channel): - if not code: - m = get_tracking_module('') - return [m.get_url()] msg = [] try: session = Session() @@ -331,7 +328,12 @@ class Module: m = get_tracking_module(package.code) msg.append(m.get_url(package.code)) if not len(msg): - msg.append('No packages found.') + # Rreturn an error only if we got a code to filter with. + if code: + msg.append('No packages found.') + else: + m = get_tracking_module('') + msg = [m.get_url()] finally: session.close() return msg @@ -360,7 +362,7 @@ class Module: code = args[1] label = ' '.join(args[2:]) elif mode.lower() == 'url': - code = ' '.join(args[1:]) if len(args) > 1 else None + code = ' '.join(args[1:]) if len(args) > 1 else '' msg = None if mode.lower() in ('start', 'add'): -- cgit v1.2.3