diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-07-24 20:50:45 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-07-24 20:50:54 +0200 |
commit | dd95fca7fbae1211a7236b4418d0178b64f46d42 (patch) | |
tree | ba3d14e99d73b596c837cc96ce238e482dd2874a | |
parent | 1e79deb14c7a9bad16d75e0bc6cef8c282bffc1c (diff) |
tracking: Return URLs for all packages unless a tracking code is passed.
-rw-r--r-- | modules/tracking.py | 12 |
1 files 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'): |