Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b0a60f

Browse files
authored
Merge pull request#835 from python-gitlab/bugfix-717
fix(cli): don't fail when the short print attr value is None
2 parents6c673c6 +8d1552a commit0b0a60f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎gitlab/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def main():
182182
ifargs.fields:
183183
fields= [x.strip()forxinargs.fields.split(",")]
184184
debug=args.debug
185-
action=args.action
185+
action=args.whaction
186186
what=args.what
187187

188188
args=args.__dict__
@@ -193,7 +193,7 @@ def main():
193193
"verbose",
194194
"debug",
195195
"what",
196-
"action",
196+
"whaction",
197197
"version",
198198
"output",
199199
):

‎gitlab/tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_parse_args(self):
116116
parser=cli._get_parser(gitlab.v4.cli)
117117
args=parser.parse_args(["project","list"])
118118
self.assertEqual(args.what,"project")
119-
self.assertEqual(args.action,"list")
119+
self.assertEqual(args.whaction,"list")
120120

121121
deftest_parser(self):
122122
parser=cli._get_parser(gitlab.v4.cli)

‎gitlab/v4/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def extend_parser(parser):
312312
object_group=subparsers.add_parser(arg_name)
313313

314314
object_subparsers=object_group.add_subparsers(
315-
title="action",dest="action",help="Action to execute."
315+
title="action",dest="whaction",help="Action to execute."
316316
)
317317
_populate_sub_parser_by_class(cls,object_subparsers)
318318
object_subparsers.required=True
@@ -406,7 +406,7 @@ def display_dict(d, padding):
406406
id=getattr(obj,obj._id_attr)
407407
print("%s: %s"% (obj._id_attr.replace("_","-"),id))
408408
ifhasattr(obj,"_short_print_attr"):
409-
value=getattr(obj,obj._short_print_attr)
409+
value=getattr(obj,obj._short_print_attr)or"None"
410410
value=value.replace("\r","").replace("\n"," ")
411411
# If the attribute is a note (ProjectCommitComment) then we do
412412
# some modifications to fit everything on one line

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp