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/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/__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/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) diff --git a/setup.py b/setup.py index 46be682..70d623d 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", @@ -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,