Skip to content

Commit

Permalink
Add version number 'v0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nieseman committed Feb 10, 2024
1 parent b20f929 commit ba65dc7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
VERSION_AND_REVISION = $(shell git describe --tags --dirty | sed -e 's/^v//')
PKG_ID = traymenu_${VERSION_AND_REVISION}_all
PYMOD_VERSION = $(shell PYTHONPATH=../src:$$PYTHONPATH python3 -c \
'import traymenu; print(traymenu.__version__)')

BUILD_DIR = ./build_dir
BASE_DIR = ${BUILD_DIR}/${PKG_ID}
Expand Down Expand Up @@ -29,6 +31,11 @@ copy_files:
cp ../doc/traymenu.svg ${ICON_DIR}
chmod -R g-w ${BASE_DIR}

.PHONY: show_version
show_version:
@echo "Traymenu version according to git: '${VERSION_AND_REVISION}'"
@echo "Traymenu version according to Python: '${PYMOD_VERSION}'"

.PHONY: clean
clean:
rm -rf ${BUILD_DIR}
5 changes: 4 additions & 1 deletion src/bin/traymenu
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
A Gtk- or Qt-based menu for the system tray to execute arbitrary commands.
"""

import os.path
import signal
import sys
import tempfile
Expand Down Expand Up @@ -35,7 +36,9 @@ def get_config() -> traymenu.Config:
return config

except ValueError as e:
usage_str = traymenu.USAGE_STR.replace("traymenu", sys.argv[0], 1)
usage_str = (traymenu.USAGE_STR.
replace("traymenu", os.path.basename(sys.argv[0]), 1).
replace("<VERSION>", traymenu.__version__))
print(f"Error: {e}")
print()
print(usage_str, end="")
Expand Down
2 changes: 2 additions & 0 deletions src/traymenu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__version__ = "0.1"

from traymenu.config import Config, USAGE_STR, \
MenuItem, Separator, SubmenuStart, SubmenuEnd, MenuEntry
from traymenu.exec import run_command, run_command_wrapper, debug_output
1 change: 1 addition & 0 deletions src/traymenu/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
--submenu <label> |
--separator |
--submenu-end } )
Program version: <VERSION>
"""


Expand Down

0 comments on commit ba65dc7

Please sign in to comment.