-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.2.10] Project template show added
- Loading branch information
Ludek Janda
committed
Nov 11, 2019
1 parent
248ad6e
commit 7bd00d1
Showing
8 changed files
with
61 additions
and
7 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
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: cp1252 -*- | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | ||
|
||
from cliff.show import ShowOne | ||
|
||
import memsource_cli | ||
from memsource_cli.lib import utils | ||
|
||
class ShowTemplate(ShowOne): | ||
""" | ||
Show template | ||
""" | ||
|
||
def get_parser(self, prog_name): | ||
"""Command argument parsing.""" | ||
parser = super(ShowTemplate, self).get_parser(prog_name) | ||
|
||
parser.add_argument( | ||
'--project-template-id', | ||
type=int, | ||
dest='project_template_id', | ||
help='project_template_id' | ||
) | ||
|
||
return parser | ||
|
||
def take_action(self, parsed_args): | ||
api = memsource_cli.ProjectTemplateApi(self.app.client) | ||
response = api.get_project_template(token=self.app.client.configuration.token, # noqa: E501 | ||
project_template_id=parsed_args.project_template_id) | ||
|
||
return utils._print_output(response) |
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