mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 10:40:44 -06:00
refactor: use actual list in metadata
This commit is contained in:
parent
5f4a4aada0
commit
9bfaea4ef0
1 changed files with 6 additions and 14 deletions
|
@ -168,10 +168,10 @@ class Ansi:
|
||||||
for row in rows:
|
for row in rows:
|
||||||
sizes = self._get_column_size(sizes, row)
|
sizes = self._get_column_size(sizes, row)
|
||||||
|
|
||||||
# header row
|
|
||||||
table_rows = (
|
table_rows = (
|
||||||
self._make_row(row)
|
self._make_row(row)
|
||||||
for row in (
|
for row in (
|
||||||
|
# header row
|
||||||
(
|
(
|
||||||
self.__dict__[header_style] + f"{cell:<{sizes[i]}}" + self.end
|
self.__dict__[header_style] + f"{cell:<{sizes[i]}}" + self.end
|
||||||
for i, cell in enumerate(rows[0])
|
for i, cell in enumerate(rows[0])
|
||||||
|
@ -331,7 +331,7 @@ class ViVenv:
|
||||||
info = {
|
info = {
|
||||||
"created": str(datetime.today()),
|
"created": str(datetime.today()),
|
||||||
"build_id": self.build_id,
|
"build_id": self.build_id,
|
||||||
"spec": str(self.spec),
|
"spec": self.spec,
|
||||||
"exe": self.exe,
|
"exe": self.exe,
|
||||||
}
|
}
|
||||||
# save metadata to json file
|
# save metadata to json file
|
||||||
|
@ -339,6 +339,7 @@ class ViVenv:
|
||||||
with (self.path / "viv-info.json").open("w") as f:
|
with (self.path / "viv-info.json").open("w") as f:
|
||||||
json.dump(info, f)
|
json.dump(info, f)
|
||||||
else:
|
else:
|
||||||
|
info["spec"] = ";".join(self.spec)
|
||||||
a.table((("key", "value"), *((k, v) for k, v in info.items())))
|
a.table((("key", "value"), *((k, v) for k, v in info.items())))
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,13 +558,7 @@ class Viv:
|
||||||
f"{vivenv.name[:6]}..."
|
f"{vivenv.name[:6]}..."
|
||||||
if len(vivenv.name) > 9
|
if len(vivenv.name) > 9
|
||||||
else vivenv.name,
|
else vivenv.name,
|
||||||
";".join(
|
";".join(vivenv.spec),
|
||||||
vivenv.spec.replace("[", "")
|
|
||||||
.replace("]", "")
|
|
||||||
.replace(" ", "")
|
|
||||||
.replace("'", "")
|
|
||||||
.split(",")
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
for vivenv in self.vivenvs.values()
|
for vivenv in self.vivenvs.values()
|
||||||
),
|
),
|
||||||
|
@ -710,9 +705,6 @@ class Viv:
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# for dev purposes TODO: delete
|
|
||||||
if not args.quiet:
|
|
||||||
echo(f"Parsed Args: {args}", hue="yellow")
|
|
||||||
args.func(args)
|
args.func(args)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue