Skip to content

Commit

Permalink
feat: display a console message with the absolute path where the acto…
Browse files Browse the repository at this point in the history
…gram is saved + bump v0.4.1

Signed-off-by: Stephen L. <LRQ3000@gmail.com>
  • Loading branch information
lrq3000 committed Jan 21, 2024
1 parent 5bc9f3c commit f4a51f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project] # beware if using setuptools: setup.py still gets executed, and even if pyproject.toml fields take precedence, if there is any code error in setup.py, building will fail!
name = "webactogram" # renamed from online-actogram according to PEP 423 https://peps.python.org/pep-0423/#pick-meaningful-names
version = "0.4.0" # see PEP 440 https://peps.python.org/pep-0440/#pre-releases and https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
version = "0.4.1" # see PEP 440 https://peps.python.org/pep-0440/#pre-releases and https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
description = "Actogram from browsers history, may help to screen sleep-wake patterns & disorders!"
authors = [
{name = "Barrett F. Davis", email = "barrettfdavis@gmail.com"},
Expand Down
5 changes: 4 additions & 1 deletion src/webactogram/webactogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ def export_actogram_png(self):
orientation = 'horizontal' if self.act.landscape else 'vertical' # orientation
pngfilepath = 'actograms/actogram_' + orientation +'_' + dt.today().date().isoformat() + '.png' # png file path
fig.savefig(pngfilepath, dpi=self.plot.DPI) # save the figure as a png
print('Saved actogram in: ' + os.path.abspath(pngfilepath)) # print the absolute path to the png file
if self.act.show:
self.show_image_with_matplotlib(pngfilepath)

Expand All @@ -779,8 +780,10 @@ def export_csv(self, filename):
size_most_recent = os.path.getsize(most_recent)

if os.path.getsize('temp.csv') >= size_most_recent:
self.act.df.to_csv('actograms/' + filename + '.csv')
csv_filepath = 'actograms/' + filename + '.csv'
self.act.df.to_csv(csv_filepath)
os.remove('temp.csv')
print('Saved actogram in: ' + os.path.abspath(csv_filepath))


## Main entry point (with arguments parser)
Expand Down

0 comments on commit f4a51f5

Please sign in to comment.