Skip to content

Commit

Permalink
Automatic backup 2023-09-16
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Sep 16, 2023
1 parent cc254c8 commit 1ef42ea
Show file tree
Hide file tree
Showing 8 changed files with 432 additions and 426 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ deal with a huge diff with a lot of unrelated changes.

### Timed

![image](svgs/timed.svg)
![image](svgs/timed.svg)
3 changes: 1 addition & 2 deletions rich_tables/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ def _str_header(data: str, header: str) -> RenderableType:
@flexitable.register
def _int_or_float(data: Union[int, float], header: str) -> ConsoleRenderable:
debug(_int_or_float, data)
# reveal_type(flexitable(["hi"], header))
return str(data)
return flexitable(str(data), header)


@flexitable.register
Expand Down
2 changes: 1 addition & 1 deletion rich_tables/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def state_color(state: str) -> str:
"PENDING": "yellow",
"OUTDATED": "yellow",
"COMMENTED": "yellow",
"CHANGES_REQUESTED": "yellow",
"CHANGES_REQUESTED": "#ffa500",
"REVIEW_REQUIRED": "red",
"DISMISSED": "gray42",
"False": "red",
Expand Down
2 changes: 2 additions & 0 deletions rich_tables/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ def syntax(*args: Any, **kwargs: Any) -> Syntax:
entry=time2human,
due=time2human,
# created=time2human,
first_active=time2human,
last_active=time2human,
createdAt=lambda x: x.replace("T", " ").replace("Z", ""),
updatedAt=lambda x: x.replace("T", " ").replace("Z", ""),
modified=time2human,
Expand Down
212 changes: 106 additions & 106 deletions svgs/jira_diff.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
377 changes: 191 additions & 186 deletions svgs/simple_json.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
254 changes: 127 additions & 127 deletions svgs/tasks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ def human(text: str) -> str:


@pytest.fixture(scope="session", autouse=True)
def populate_readme():
def populate_readme() -> None:
yield

svgs = "\n\n".join(f"### {human(x)}\n\n![image](svgs/{x}.svg)" for x in TEST_CASES)

with open("README.md") as f:
readme = f.read()

readme = re.sub(r"(## Examples.).*", rf"\1{svgs}", readme, flags=re.M | re.S)
readme = re.sub(r"(## Examples).*", rf"\1\n\n{svgs}", readme, flags=re.M | re.S)

with open("README.md", "w") as f:
f.write(readme)


@freeze_time("2022-04-01")
@pytest.mark.parametrize("testcase", TEST_CASES)
def test_outputs(testcase):
def test_outputs(testcase: str) -> None:
with open(os.path.join(JSON_DIR, f"{testcase}.json"), "r") as f:
data = json.load(f)

Expand Down

0 comments on commit 1ef42ea

Please sign in to comment.