Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
1d77610f
Unverified
Commit
1d77610f
authored
Dec 05, 2024
by
Jakob Görgen
Browse files
cli/simbricks/cli/utils: function to print namespace table
parent
d2314e04
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
symphony/cli/simbricks/cli/utils.py
symphony/cli/simbricks/cli/utils.py
+14
-1
No files found.
symphony/cli/simbricks/cli/utils.py
View file @
1d77610f
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
import
asyncio
import
asyncio
import
functools
import
functools
from
rich.table
import
Table
from
rich.console
import
Console
def
async_cli
():
def
async_cli
():
"""
"""
...
@@ -33,4 +35,15 @@ def async_cli():
...
@@ -33,4 +35,15 @@ def async_cli():
def
wrapper
(
*
args
,
**
kwargs
):
def
wrapper
(
*
args
,
**
kwargs
):
return
asyncio
.
run
(
f
(
*
args
,
**
kwargs
))
return
asyncio
.
run
(
f
(
*
args
,
**
kwargs
))
return
wrapper
return
wrapper
return
decorator_async_cli
return
decorator_async_cli
\ No newline at end of file
def
print_namespace_table
(
namespaces
)
->
None
:
table
=
Table
()
table
.
add_column
(
"Id"
)
table
.
add_column
(
"name"
)
table
.
add_column
(
"parent"
)
for
ns
in
namespaces
:
table
.
add_row
(
str
(
ns
[
"id"
]),
str
(
ns
[
"name"
]),
str
(
ns
[
"parent_id"
]))
console
=
Console
()
console
.
print
(
table
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment