diff options
author | Papoteur <papoteur@mageia.org> | 2020-06-10 19:05:02 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2020-06-10 19:05:16 +0200 |
commit | 8db876464bf5ac600d00e9d77455d5660217a6b9 (patch) | |
tree | 4e810dbd46c5f52835e54b383911e18575f191eb | |
parent | 86223833ac26b99549a8933d39ea1f2aa54e54b2 (diff) | |
download | isodumper-8db876464bf5ac600d00e9d77455d5660217a6b9.tar isodumper-8db876464bf5ac600d00e9d77455d5660217a6b9.tar.gz isodumper-8db876464bf5ac600d00e9d77455d5660217a6b9.tar.bz2 isodumper-8db876464bf5ac600d00e9d77455d5660217a6b9.tar.xz isodumper-8db876464bf5ac600d00e9d77455d5660217a6b9.zip |
Add parsing of arguments from command line (use python-manatools)
-rwxr-xr-x | lib/isodumper.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index b620bf8..984d037 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -49,6 +49,10 @@ from pydbus import SystemBus from gi.repository import GLib import psutil +import manatools.args as args + +RELEASE="v1.17" + class NoUDisks2(Exception): pass @@ -116,11 +120,12 @@ class Info(object): self.richtext=richtext self.text=text - +class ParseCLI(args.AppArgs): + def __init(self, command): + super().__init__(command) + class IsoDumper(object): - RELEASE="v1.17" - def get_devices(self): self.list=self.u.find_devices() while len(self.list)==0: @@ -501,7 +506,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog """ Init/Constructor for the 'widgets' """ - yui.YUI.app().setApplicationTitle(_("IsoDumper")+" "+self.RELEASE) + yui.YUI.app().setApplicationTitle(_("IsoDumper") + " " + RELEASE) yui.YUI.app().setApplicationIcon("/usr/share/icons/isodumper.png") self.atelier = yui.YUI.widgetFactory() self.dialog = self.atelier.createPopupDialog() @@ -768,8 +773,12 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog if __name__ == "__main__": # Send the yui logging outside of the console yui.YUILog.setLogFileName("/dev/null") - app = IsoDumper() - app.run() - # next line seems to be a workaround to prevent the qt-app from crashing - # see https://github.com/libyui/libyui-qt/issues/41 - yui.YUILoader.deleteUI() + parser = ParseCLI('isodumper') + if parser.args.version: + print(RELEASE) + else: + app = IsoDumper() + app.run() + # next line seems to be a workaround to prevent the qt-app from crashing + # see https://github.com/libyui/libyui-qt/issues/41 + yui.YUILoader.deleteUI() |