From: W. Trevor King Date: Sat, 5 Dec 2009 09:21:04 +0000 (-0500) Subject: More 'DIR'->diff.BUGDIR_ID updates X-Git-Tag: 1.0.0~59^2~64^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3cf0394832176a18f658ef3a89521bcccd57cb9e;p=be.git More 'DIR'->diff.BUGDIR_ID updates --- diff --git a/becommands/diff.py b/becommands/diff.py index e2ff052..2cff537 100644 --- a/becommands/diff.py +++ b/becommands/diff.py @@ -40,7 +40,7 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): Changed bug settings: status: open -> closed >>> if bd.vcs.versioned == True: - ... execute(["--subscribe", "DIR:mod", "--uuids", original], + ... execute(["--subscribe", "%(bugdir_id)s:mod", "--uuids", original], ... manipulate_encodings=False) ... else: ... print "a" @@ -53,7 +53,7 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): ... UsageError: This directory is not revision-controlled. >>> bd.cleanup() - """ + """ % {'bugdir_id':diff.BUGDIR_ID} parser = get_parser() options, args = parser.parse_args(args) cmdutil.default_complete(options, args, parser) diff --git a/becommands/subscribe.py b/becommands/subscribe.py index 3f4998e..19aac53 100644 --- a/becommands/subscribe.py +++ b/becommands/subscribe.py @@ -91,7 +91,7 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): servers = options.servers.split(",") types = options.types.split(",") - if len(args) == 0 or args[0] == "DIR": # directory-wide subscriptions + if len(args) == 0 or args[0] == diff.BUGDIR_ID: # directory-wide subscriptions type_root = diff.BUGDIR_TYPE_ALL entity = bd entity_name = "bug directory" @@ -314,7 +314,7 @@ def get_bugdir_subscribers(bugdir, server): Returns a dict of dicts: subscribers[user][id] = types where id is either a bug.uuid (in the case of a bug subscription) - or "DIR" (in the case of a bugdir subscription). + or "%(bugdir_id)s" (in the case of a bugdir subscription). Only checks bugs that are currently in memory, so you might want to call bugdir.load_all_bugs() first. @@ -328,16 +328,16 @@ def get_bugdir_subscribers(bugdir, server): >>> a.extra_strings = subscribe(a.extra_strings, "John Doe ", ... [diff.BUG_TYPE_ALL], ["a.com"], diff.BUG_TYPE_ALL) >>> subscribers = get_bugdir_subscribers(bd, "a.com") - >>> subscribers["Jane Doe "]["DIR"] + >>> subscribers["Jane Doe "]["%(bugdir_id)s"] [] - >>> subscribers["John Doe "]["DIR"] + >>> subscribers["John Doe "]["%(bugdir_id)s"] [] >>> subscribers["John Doe "]["a"] [] >>> get_bugdir_subscribers(bd, "b.net") - {'Jane Doe ': {'DIR': []}} + {'Jane Doe ': {'%(bugdir_id)s': []}} >>> bd.cleanup() - """ + """ % {'bugdir_id':diff.BUGDIR_ID} subscribers = {} for sub in get_subscribers(bugdir.extra_strings, diff.BUGDIR_TYPE_ALL, server, diff.BUGDIR_TYPE_ALL,