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

chore: make Get.*Mixin._optional_get_attrs always present#1412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intopython-gitlab:masterfromJohnVillalovos:jlvillal/optional_get_attrs
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionsgitlab/mixins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,6 +22,7 @@
Dict,
List,
Optional,
Tuple,
Type,
TYPE_CHECKING,
Union,
Expand DownExpand Up@@ -74,6 +75,7 @@ class GetMixin(_RestManagerBase):
_computed_path: Optional[str]
_from_parent_attrs: Dict[str, Any]
_obj_cls: Optional[Type[base.RESTObject]]
_optional_get_attrs: Tuple[str, ...] = ()
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
Expand DownExpand Up@@ -118,6 +120,7 @@ class GetWithoutIdMixin(_RestManagerBase):
_computed_path: Optional[str]
_from_parent_attrs: Dict[str, Any]
_obj_cls: Optional[Type[base.RESTObject]]
_optional_get_attrs: Tuple[str, ...] = ()
_parent: Optional[base.RESTObject]
_parent_attrs: Dict[str, Any]
_path: Optional[str]
Expand Down
11 changes: 4 additions & 7 deletionsgitlab/v4/cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -168,13 +168,10 @@ def _populate_sub_parser_by_class(cls, sub_parser):
id_attr = cls._id_attr.replace("_", "-")
sub_parser_action.add_argument("--%s" % id_attr, required=True)

if hasattr(mgr_cls, "_optional_get_attrs"):
[
sub_parser_action.add_argument(
"--%s" % x.replace("_", "-"), required=False
)
for x in mgr_cls._optional_get_attrs
]
for x in mgr_cls._optional_get_attrs:
sub_parser_action.add_argument(
"--%s" % x.replace("_", "-"), required=False
)

if action_name == "create":
for x in mgr_cls._create_attrs.required:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp