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

Custom cli actions fix#760

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
Merged
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
10 changes: 5 additions & 5 deletionsgitlab/v4/cli.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -80,10 +80,10 @@ def do_custom(self):
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.cls):
data[self.cls._id_attr] = self.args.pop(self.cls._id_attr)
o = self.cls(self.mgr, data)
method_name = self.action.replace('-', '_')
return getattr(o, method_name)(**self.args)
else:
return getattr(self.mgr, self.action)(**self.args)
o = self.mgr
method_name = self.action.replace('-', '_')
return getattr(o, method_name)(**self.args)

def do_project_export_download(self):
try:
Expand DownExpand Up@@ -217,14 +217,14 @@ def _populate_sub_parser_by_class(cls, sub_parser):
for x in mgr_cls._from_parent_attrs]
sub_parser_action.add_argument("--sudo", required=False)

required, optional, needs_id = cli.custom_actions[name][action_name]
# We need to get the object somehow
if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):
ifneeds_id andgitlab.mixins.GetWithoutIdMixin not in inspect.getmro(cls):
if cls._id_attr is not None:
id_attr = cls._id_attr.replace('_', '-')
sub_parser_action.add_argument("--%s" % id_attr,
required=True)

required, optional, dummy = cli.custom_actions[name][action_name]
[sub_parser_action.add_argument("--%s" % x.replace('_', '-'),
required=True)
for x in required if x != cls._id_attr]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp