From fbb8504a6c0438e90b046e44a60608159f4e3f63 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 5 Dec 2009 04:11:39 -0500 Subject: Created diff.subscriptions_from_string() --- becommands/diff.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'becommands') diff --git a/becommands/diff.py b/becommands/diff.py index 5a94462..e2ff052 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -63,17 +63,11 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): revision = args[0] if len(args) > 1: raise cmdutil.UsageError('Too many arguments.') - if options.subscribe == None: - subscriptions = [diff.Subscription(diff.BUGDIR_ID, - diff.BUGDIR_TYPE_ALL)] - else: - subscriptions = [] - for subscription in options.subscribe.split(','): - fields = subscription.split(':') - if len(fields) != 2: - raise cmdutil.UsageError('Invalid subscription "%s", should be ID:TYPE') - id,type = fields - subscriptions.append(diff.Subscription(id, type)) + try: + subscriptions = diff.subscriptions_from_string( + options.subscribe) + except ValueError, e: + raise cmdutil.UsageError(e.msg) bd = bugdir.BugDir(from_disk=True, manipulate_encodings=manipulate_encodings) if bd.vcs.versioned == False: -- cgit