Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions librocco_receipt_printer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,22 @@ def main():
print("Exiting")


def dry_run():
"""Dry run is used for `librocco-print-test` command. It prints a canned receipt
and is used to test the printer being connected and accessible.

TODO: This should most definitely be an actual printer, not a test file

TODO: When we proceed with the implementation (and formatting of receipts) we'd
probably want to store a dummy receipt and print it out (instead of just printing out the "Test receipt" string)
"""

printer = DevPrinter(PRINT_OUTPUT_FILE)
printer.print("Test receipt\n")


if __name__ == "__main__":
main()

if __name__ == "__dry_run__":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this serves any purpose. it should be removed.

dry_run()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
entry_points={
"console_scripts": [
"librocco-receipt-printer=librocco_receipt_printer.cli:main",
"librocco-print-test=librocco_receipt_printer.cli:dry_run",
],
},
)