From dbcf910e9b5ffdd6bd33348ac50a47f9cdf6687f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 25 Jun 2018 20:49:48 +0100 Subject: filter-active.py: Introduce inc_releases variable Changing attributes of the options object is weird; use a separate variable instead. --- scripts/filter-active.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/filter-active.py b/scripts/filter-active.py index 0f088789..0fb274fc 100755 --- a/scripts/filter-active.py +++ b/scripts/filter-active.py @@ -108,6 +108,7 @@ if __name__ == '__main__': if not options.states and not options.notstates: print('I: Excluding N/A, ignored and released issues') options.notstates = ['N/A', 'ignored', 'released'] + inc_releases = options.release if options.color is None: options.color = sys.stdout.isatty() if options.color: @@ -131,29 +132,29 @@ if __name__ == '__main__': issues = issues + get_issues(d) if options.states or options.notstates: - issues = filter_out_states(issues, options.release, + issues = filter_out_states(issues, inc_releases, options.states, options.notstates) if not options.release: all_releases = set() for i in issues: all_releases |= set(i.get_releases()) - options.release = sorted(list(all_releases)) + inc_releases = sorted(list(all_releases)) - if len(options.release) == 1: + if len(inc_releases) == 1: min_width = 0 max_width = 1000 else: min_width = 20 max_width = 20 sys.stdout.write(" ") - for release in options.release: + for release in inc_releases: sys.stdout.write(" %-20.20s " % release) sys.stdout.write("\n") for i in issues: sys.stdout.write("%17s:" % i.name) - for release in options.release: + for release in inc_releases: status = i.status(release) or "unknown" status_short = status.split(' ')[0] if options.color and status_color.has_key(status_short): -- cgit v1.2.3