Commit 79fdbc51 authored by Emanuele Petriglia's avatar Emanuele Petriglia Committed by Sean Davis

Use configurated appname instead of argv[0]

I introduced a new module called 'info', it is edited by the Makefile to
hardcopy the application name and version.
parent 2fbb58ca
Pipeline #649 passed with stage
in 18 seconds
......@@ -8,3 +8,5 @@ Makefile
locale
bin/xfce4-panel-profiles
bin/xfce4-panel-profiles.in
xfce4-panel-profiles/info.py
xfce4-panel-profiles/info.py.in
......@@ -12,6 +12,10 @@ all: $(LANGUAGE_FILES) layouts
chmod +x xfce4-panel-profiles.desktop
sed -e s,%prefix%,$(PREFIX), bin/$(APPNAME).in.in > bin/$(APPNAME).in
sed -e s,%python%,$(PYTHON), bin/$(APPNAME).in > bin/$(APPNAME)
sed -e s,%appname%,$(APPNAME), xfce4-panel-profiles/info.py.in.in > xfce4-panel-profiles/info.py.in
sed -e s,%version%,$(VERSION), xfce4-panel-profiles/info.py.in > xfce4-panel-profiles/info.py
chmod +x bin/$(APPNAME)
locale/%/LC_MESSAGES/$(APPNAME).mo: po/%.po
......@@ -39,6 +43,7 @@ install: all xfce4-panel-profiles.1.gz
install bin/$(APPNAME) $(DESTDIR)/$(PREFIX)/bin
install -d $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
install xfce4-panel-profiles/info.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
install xfce4-panel-profiles/panelconfig.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
install xfce4-panel-profiles/xfce4-panel-profiles.py $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
install xfce4-panel-profiles/xfce4-panel-profiles.glade $(DESTDIR)/$(PREFIX)/share/$(APPNAME)/xfce4-panel-profiles
......@@ -94,3 +99,5 @@ clean:
rm -f Makefile.in
rm -f Makefile
rm -f xfce4-panel-profiles.1.gz
rm -f xfce4-panel-profiles/info.py
rm -f xfce4-panel-profiles/info.py.in
appname = '%appname%'
version = '%version%'
......@@ -37,6 +37,8 @@ from gi.repository import Gtk, GLib, Gio
from panelconfig import PanelConfig
import info
warnings.filterwarnings("ignore")
homedir = GLib.get_home_dir()
......@@ -414,11 +416,14 @@ if __name__ == "__main__":
print(repr(e))
exit(1)
exit(0)
elif sys.argv[1] == '--version':
print(info.appname + ' ' + info.version)
exit(0)
else:
print('Xfce Panel Profiles - Usage:')
print(sys.argv[0] + ' : load graphical user interface.')
print(sys.argv[0] + ' save <filename> : save current configuration.')
print(sys.argv[0] + ' load <filename> : load configuration from file.')
print(info.appname + ' : load graphical user interface.')
print(info.appname + ' save <filename> : save current configuration.')
print(info.appname + ' load <filename> : load configuration from file.')
print('')
exit(-1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment