project.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:polyaxon-cli 作者: polyaxon 项目源码 文件源码
def update(project, name, description):
    """Update project.

    Example:
polyaxon update foobar --description=Image Classification with Deep Learning using TensorFlow
```

```
polyaxon update mike1/foobar --description=Image Classification with Deep Learning using TensorFlow
```
"""
user, project_name = get_project_or_local(project)

update_dict = {}
if name:
    update_dict['name'] = name

if description:
    update_dict['description'] = description

if not update_dict:
    Printer.print_warning('No argument was provided to update the project.')
    sys.exit(1)

try:
    response = PolyaxonClients().project.update_project(user, project_name, update_dict)
except (PolyaxonHTTPError, PolyaxonShouldExitError) as e:
    Printer.print_error('Could not update project `{}`.'.format(project))
    Printer.print_error('Error message `{}`.'.format(e))
    sys.exit(1)

Printer.print_success("Project updated.")
response = response.to_light_dict()
Printer.print_header("Project info:")
dict_tabulate(response)

```

评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号