-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from bundlewrap/3
3.0
- Loading branch information
Showing
50 changed files
with
1,084 additions
and
901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from ..utils import names | ||
from ..group import GROUP_ATTR_DEFAULTS | ||
from ..utils.text import bold, mark_for_translation as _ | ||
from ..utils.ui import io | ||
from .nodes import _attribute_table | ||
|
||
|
||
GROUP_ATTRS = sorted(list(GROUP_ATTR_DEFAULTS) + ['nodes']) | ||
GROUP_ATTRS_LISTS = ('nodes',) | ||
|
||
|
||
def bw_groups(repo, args): | ||
for group in repo.groups: | ||
line = group.name | ||
if args['show_nodes']: | ||
line += ": " + ", ".join(names(group.nodes)) | ||
io.stdout(line) | ||
if not args['groups']: | ||
for group in repo.groups: | ||
io.stdout(group.name) | ||
else: | ||
groups = [repo.get_group(group.strip()) for group in args['groups'].split(",")] | ||
if not args['attrs']: | ||
subgroups = set(groups) | ||
for group in groups: | ||
subgroups = subgroups.union(group.subgroups) | ||
for subgroup in sorted(subgroups): | ||
io.stdout(subgroup.name) | ||
else: | ||
_attribute_table( | ||
groups, | ||
bold(_("group")), | ||
args['attrs'], | ||
GROUP_ATTRS, | ||
GROUP_ATTRS_LISTS, | ||
args['inline'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.