Skip to content

Commit

Permalink
Include environment version info
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesridgway committed Mar 5, 2022
1 parent fa3737e commit 2216b18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions attachment_downloader/version_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import platform

VERSION_FILENAME = os.path.abspath(os.path.join(os.path.dirname(__file__), 'version.py'))
import subprocess
Expand Down Expand Up @@ -29,3 +30,8 @@ def get(retry=True):
Version.generate()
return Version.get(False)
return 'unknown'

@staticmethod
def get_env_info():
os = f"Release: {platform.release()}, Platform: {platform.platform()}"
return f"(Python: {platform.python_version()}), OS: ({os})"
2 changes: 1 addition & 1 deletion bin/attachment-downloader
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from attachment_downloader.version_info import Version

if __name__ == '__main__':
Logger.setup()
logging.info(f'Attachment Downloader - Version: {Version.get()}')
logging.info(f'Attachment Downloader - Version: {Version.get()} {Version.get_env_info()}')

if sys.version_info[0] < 3:
logging.error("This application requires Python 3+, you are running version: %s", sys.version)
Expand Down

0 comments on commit 2216b18

Please sign in to comment.