From fdd47e40c0e181793ca50e3dac1a9f0a25644ccb Mon Sep 17 00:00:00 2001 From: Wasi Mohammed Abdullah Date: Fri, 3 Nov 2023 16:56:22 +0600 Subject: [PATCH 1/3] bump version --- HISTORY.rst | 9 ++++++++- PyTM/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 392c66e..d8c6541 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -64,4 +64,11 @@ History * Added invoice sub command. * Added invoice manual command to generate manual invoice using prompts. * Added invoice auto command to generate invoice from existing projects. -* invoice manual and auto command generates HTML invoices using Tailwind CSS and opens it in a Browser. \ No newline at end of file +* invoice manual and auto command generates HTML invoices using Tailwind CSS and opens it in a Browser. + +0.0.10 (2023-11-03) +------------------- + +* open invoices using python's standard library. +* code refactor +* bug fix diff --git a/PyTM/__init__.py b/PyTM/__init__.py index ffa059a..ef5dc3c 100644 --- a/PyTM/__init__.py +++ b/PyTM/__init__.py @@ -1,3 +1,3 @@ __author__ = "Wasi" __email__ = "wasi0013@gmail.com" -__version__ = "0.0.9" +__version__ = "0.0.10" diff --git a/setup.py b/setup.py index 46be682..b268268 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( name="python-pytm", - version="0.0.9", + version="0.0.10", description="PyTM - an Open Source Python Time Management Tool for Mankind", long_description=readme + "\n\n" + doclink + "\n\n" + history, long_description_content_type="text/x-rst", From b9d685248f5059514b7af56a6192da1b7e3b2b31 Mon Sep 17 00:00:00 2001 From: Wasi Mohammed Abdullah Date: Fri, 3 Nov 2023 17:00:11 +0600 Subject: [PATCH 2/3] open invoice urls using standard library instead of os.system call --- Invoice.html | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ PyTM/cli.py | 6 ++-- 2 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 Invoice.html diff --git a/Invoice.html b/Invoice.html new file mode 100644 index 0000000..af176a5 --- /dev/null +++ b/Invoice.html @@ -0,0 +1,96 @@ + + + + + + Invoice + + + +
+
+
+
+ Wasi +
+

Wasi

+

Chittagong, Bangladesh.

+

say@hellowasi.com

+

+8801858503621

+

wasi0013.com

+
+
+
+

Invoice 16

+

Date: 2023-11-03

+

Bill to

+

Anonymous Client

+

earth

+ + + +
+
+
+

Project: Hello World!

+

Date: 2023-11-03

+

Duration: 02 mins 27 secs

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TaskDescriptionHoursHourly RateFee
Todo-0.3875.00$28.68
Running-0.0375.00$1.94
+
+
+
+
+ + + + + + + + + + + + + +
Subtotal:30.62$
Discount:0.00$
Total:30.62$
+
+
+
+
+

Thank you for your business.

+
+
+
+ + diff --git a/PyTM/cli.py b/PyTM/cli.py index 29a60a1..863bdbc 100644 --- a/PyTM/cli.py +++ b/PyTM/cli.py @@ -14,6 +14,7 @@ from rich.table import Table from rich.prompt import Prompt from rich.prompt import Confirm +import webbrowser def greet(): """ shows Greeting Texts @@ -233,8 +234,7 @@ def auto(project_name): with open(html_file, "w") as f: f.write(html) console.print(f"The invoice is available in {html_file}") - os.system(f"sensible-browser {html_file}") - + webbrowser.open(f"file:///{html_file}", autoraise=True) @invoice.command() def manual(): """ @@ -293,7 +293,7 @@ def manual(): with open(html_file, "w") as f: f.write(html) console.print(f"The invoice is available in {html_file}") - os.system(f"sensible-browser {html_file}") + webbrowser.open(f"file:///{html_file}", autoraise=True) From 531618a12cef81c726c85b4d9b0ae8c4b6327b51 Mon Sep 17 00:00:00 2001 From: Wasi Mohammed Abdullah Date: Fri, 3 Nov 2023 22:53:18 +0600 Subject: [PATCH 3/3] fixed bug in setup.py --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index b268268..70d623d 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,8 @@ url="https://github.com/wasi0013/PyTM", packages=[ "PyTM", + "PyTM.commands", + "PyTM.core" ], package_dir={"python-pytm": "PyTM"}, include_package_data=True,