Skip to content

Commit

Permalink
Merge pull request #28 from wolff01/master
Browse files Browse the repository at this point in the history
added constants.py and test_constants.py
  • Loading branch information
jnormile authored Dec 8, 2023
2 parents ae309a0 + 8f4c6d5 commit 300a4d9
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 18 deletions.
30 changes: 30 additions & 0 deletions cellveyor/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Define constants with dataclasses for use in Cellveyor"""

from dataclasses import dataclass


# humanreadable constant
@dataclass(frozen=True)
class Humanreadable:
"""Define the Humanreadable dataclass for constant(s)."""

Yes: str
No: str


humanreadable = Humanreadable(Yes="Yes", No="No")


# markers constant
@dataclass(frozen=True)
class Markers:
"""Define the Markers dataclass for constant(s)."""

Indent: str
Newline: str


markers = Markers(
Indent=" ",
Newline="\n",
)
6 changes: 4 additions & 2 deletions cellveyor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.markdown import Markdown
from rich.panel import Panel

from cellveyor import data, filesystem, report, transfer
from cellveyor import constants, data, filesystem, report, transfer

# create a Typer object to support the command-line interface
cli = typer.Typer(no_args_is_help=True)
Expand All @@ -25,7 +25,9 @@ def display_reports(reports_dict: Dict[str, str]) -> None:
current_report = reports_dict[current_report_key]
# display the report inside of a rich panel, using
# a markdown-based formatter for the report's contents
console.print(Panel(Markdown(current_report), title="Report", expand=False))
console.print(
f"{constants.markers.Indent} {Panel(Markdown(current_report), title='Report', expand=False)} {constants.markers.Newline}"
)
console.print()


Expand Down
Loading

0 comments on commit 300a4d9

Please sign in to comment.