Skip to content

Commit

Permalink
Automatic backup 2024-02-17
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Feb 18, 2024
1 parent 5c2e040 commit a347894
Show file tree
Hide file tree
Showing 6 changed files with 572 additions and 599 deletions.
28 changes: 14 additions & 14 deletions rich_tables/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ def counts_table(data: List[JSONDict]) -> Table:
FIELDS_MAP: MutableMapping[str, Callable[..., RenderableType]] = defaultdict(
lambda: str,
diff=lambda x: Text.from_markup(json.dumps(diff(*x), indent=2).replace('"', "")),
albumtypes=lambda x: "; ".join(
map(
format_with_color,
{
"album; compilation": "comp",
"dj-mix; broadcast": "dj-mix",
"broadcast; dj-mix": "dj-mix",
}
.get(x, x)
.split("; "),
)
),
# albumtypes=lambda x: "; ".join(
# map(
# format_with_color,
# {
# "album; compilation": "comp",
# "dj-mix; broadcast": "dj-mix",
# "broadcast; dj-mix": "dj-mix",
# }
# .get(x, x)
# .split("; "),
# )
# ),
author=format_with_color_on_black,
labels=lambda x: (
wrap(" ".join(wrap(y["name"].upper(), f"#{y['color']}") for y in x), "b")
Expand Down Expand Up @@ -129,7 +129,7 @@ def counts_table(data: List[JSONDict]) -> Table:
if isinstance(x, int)
else x
),
# length=timestamp2timestr,
length=timestamp2timestr,
tracktotal=lambda x: (
(wrap("{}", "b cyan") + "/" + wrap("{}", "b cyan")).format(*x)
if isinstance(x, Iterable) and not isinstance(x, str)
Expand Down Expand Up @@ -195,7 +195,7 @@ def counts_table(data: List[JSONDict]) -> Table:
"category",
"Category",
"code",
"data_source",
# "data_source",
"default_start_time",
"default_end_time",
"Description",
Expand Down
2 changes: 1 addition & 1 deletion rich_tables/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def _json_dict(data: JSONDict) -> RenderableType:
@flexitable.register
@debug
def _str_list(data: List[str]) -> RenderableType:
return ", ".join(map(format_with_color, map(str, data)))
return format_with_color(data)


@flexitable.register
Expand Down
Loading

0 comments on commit a347894

Please sign in to comment.