aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 51e85ff..e43fda5 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -28,6 +28,7 @@
# ensure we're using the latest build, if called from our build environment
import sys
import importlib
+import logging
try:
from isodumper import version
@@ -118,7 +119,6 @@ class UDisks2(object):
if objects[block['path']][self.SERVICE + '.Partition']['Table'].split('/')[-1] == target:
if (self.SERVICE + '.Encrypted' in objects[block['path']]): # Is the partition encrypted ?
path_to_encrypted = objects[block['path']][self.SERVICE + '.Encrypted']['CleartextDevice']
- print(path_to_encrypted)
if path_to_encrypted != '/':
iface = self.bus.get(self.SERVICE, path_to_encrypted)
fs = iface[self.SERVICE + '.Filesystem']
@@ -127,12 +127,16 @@ class UDisks2(object):
iface = self.bus.get(self.SERVICE, block['path'])
fs = iface[self.SERVICE + '.Encrypted']
fs.Lock({})
+ logging.debug(f"Unmounting encryted {block['path']}")
else:
iface = self.bus.get(self.SERVICE, block['path'])
if self.SERVICE + '.Filesystem' in objects[block['path']]:
fs = iface[self.SERVICE + '.Filesystem']
if fs.MountPoints: # partition is mounted
+ logging.debug(f"Unmounting {block['path']}")
fs.Unmount({})
+ else:
+ logging.debug(f"Not mounted {block['path']}")
return True, ""
def eject(self, device):
@@ -555,7 +559,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
if self.ask_OK(info):
return
- def __init__(self):
+ def __init__(self, debug=False):
APP = "isodumper"
DIR = "/usr/share/locale"
# Call translation catalog
@@ -572,6 +576,10 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog
exit()
# TODO Read log level from command line
+ level = logging.DEBUG if debug else logging.ERROR
+ logging.basicConfig(filename=os.path.join(os.path.expanduser('~'), '.isodumper',"isodumper2.log"),
+ format='%(asctime)s %(levelname)-8s %(message)s',
+ level=level)
# define size of the selected device
self.deviceSize = 0
@@ -857,10 +865,14 @@ if __name__ == "__main__":
# Send the yui logging outside of the console
log = yui.YUILog.setLogFileName("/dev/null")
parser = ParseCLI('isodumper')
+ parser.parser.add_argument('--debug', help=_('allow debug information'), action='store_true')
if parser.args.version:
print(version.RELEASE)
else:
- app = IsoDumper()
+ if parser.args.debug:
+ app = IsoDumper(debug=True)
+ 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