17
17
# limitations under the License.
18
18
r"""Renku CLI commands for handling of projects.
19
19
20
+ Showing project metadata
21
+ ~~~~~~~~~~~~~~~~~~~~~~~~
22
+
23
+ You can see the metadata of the current project by using ``renku project show``:
24
+ .. code-block:: console
25
+
26
+ $ renku project show
27
+ Id: /projects/john.doe/flights-tutorial
28
+ Name: flights-tutorial
29
+ Description: Flight tutorial project
30
+ Creator: John Doe <John [email protected] >
31
+ Created: 2021-11-05T10:32:57+01:00
32
+ Keywords: keyword1, keyword2
33
+ Renku Version: 1.0.0
34
+ Project Template: python-minimal (1.0.0)
35
+
36
+
20
37
Editing projects
21
38
~~~~~~~~~~~~~~~~
22
39
@@ -55,6 +72,7 @@ def project():
55
72
56
73
@project .command ()
57
74
@click .option ("-d" , "--description" , default = None , type = click .STRING , help = "Project's description." )
75
+ @click .option ("-k" , "--keyword" , default = None , multiple = True , type = click .STRING , help = "List of keywords." )
58
76
@click .option (
59
77
"-c" ,
60
78
"--creator" ,
@@ -69,7 +87,7 @@ def project():
69
87
type = click .Path (exists = True , dir_okay = False ),
70
88
help = "Custom metadata to be associated with the project." ,
71
89
)
72
- def edit (description , creator , metadata ):
90
+ def edit (description , keyword , creator , metadata ):
73
91
"""Edit project metadata."""
74
92
from renku .core .commands .project import edit_project_command
75
93
@@ -81,7 +99,7 @@ def edit(description, creator, metadata):
81
99
result = (
82
100
edit_project_command ()
83
101
.build ()
84
- .execute (description = description , creator = creator , custom_metadata = custom_metadata )
102
+ .execute (description = description , creator = creator , keywords = keyword , custom_metadata = custom_metadata )
85
103
)
86
104
87
105
updated , no_email_warning = result .output
@@ -92,3 +110,30 @@ def edit(description, creator, metadata):
92
110
click .echo ("Successfully updated: {}." .format (", " .join (updated .keys ())))
93
111
if no_email_warning :
94
112
click .echo (ClickCallback .WARNING + f"No email or wrong format for: { no_email_warning } " )
113
+
114
+
115
+ def _print_project (project ):
116
+ """Print project metadata."""
117
+ click .echo (click .style ("Id: " , bold = True , fg = "magenta" ) + click .style (project .id , bold = True ))
118
+ click .echo (click .style ("Name: " , bold = True , fg = "magenta" ) + click .style (project .name , bold = True ))
119
+ click .echo (click .style ("Description: " , bold = True , fg = "magenta" ) + click .style (project .description , bold = True ))
120
+ click .echo (click .style ("Creator: " , bold = True , fg = "magenta" ) + click .style (project .creator_str , bold = True ))
121
+ click .echo (click .style ("Created: " , bold = True , fg = "magenta" ) + click .style (project .created_str , bold = True ))
122
+ click .echo (click .style ("Keywords: " , bold = True , fg = "magenta" ) + click .style (project .keywords_str , bold = True ))
123
+ click .echo (click .style ("Renku Version: " , bold = True , fg = "magenta" ) + click .style (project .agent , bold = True ))
124
+ click .echo (
125
+ click .style ("Project Template: " , bold = True , fg = "magenta" ) + click .style (project .template_info , bold = True )
126
+ )
127
+
128
+ if project .annotations :
129
+ click .echo (click .style ("Annotations: " , bold = True , fg = "magenta" ) + click .style (project .annotations , bold = True ))
130
+
131
+
132
+ @project .command ()
133
+ def show ():
134
+ """Show details for the project."""
135
+ from renku .core .commands .project import show_project_command
136
+
137
+ project = show_project_command ().build ().execute ().output
138
+
139
+ _print_project (project )
0 commit comments