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

Commit6d55120

Browse files
chore: make RESTObject._short_print_attrs always present
Always create RESTObject._short_print_attrs with a default value ofNone.This way we don't need to use hasattr() and we will know the type ofthe attribute.
1 parentcfc42d2 commit6d55120

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎gitlab/base.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class RESTObject(object):
4545
_attrs:Dict[str,Any]
4646
_module:ModuleType
4747
_parent_attrs:Dict[str,Any]
48+
_short_print_attr:Optional[str]=None
4849
_updated_attrs:Dict[str,Any]
4950
manager:"RESTManager"
5051

‎gitlab/v4/cli.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def display_dict(d, padding):
380380
ifobj._id_attr:
381381
id=getattr(obj,obj._id_attr)
382382
print("%s: %s"% (obj._id_attr.replace("_","-"),id))
383-
ifhasattr(obj,"_short_print_attr"):
383+
ifobj._short_print_attr:
384384
value=getattr(obj,obj._short_print_attr)or"None"
385385
value=value.replace("\r","").replace("\n"," ")
386386
# If the attribute is a note (ProjectCommitComment) then we do

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp