aboutsummaryrefslogtreecommitdiffstats
path: root/lib/isodumper.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-06-10 19:05:02 +0200
committerPapoteur <papoteur@mageia.org>2020-06-10 19:05:16 +0200
commit8db876464bf5ac600d00e9d77455d5660217a6b9 (patch)
tree4e810dbd46c5f52835e54b383911e18575f191eb /lib/isodumper.py
parent86223833ac26b99549a8933d39ea1f2aa54e54b2 (diff)
downloadisodumper-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)
Diffstat (limited to 'lib/isodumper.py')
-rwxr-xr-xlib/isodumper.py27
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()