aboutsummaryrefslogtreecommitdiffstats
path: root/backend/magiback
diff options
context:
space:
mode:
Diffstat (limited to 'backend/magiback')
-rwxr-xr-xbackend/magiback14
1 files changed, 12 insertions, 2 deletions
diff --git a/backend/magiback b/backend/magiback
index 7f3785b..25eff28 100755
--- a/backend/magiback
+++ b/backend/magiback
@@ -4,10 +4,15 @@ from gi.repository import GLib
from pydbus import SystemBus
import isodumper.raw_write as raw_write
import threading
+import gettext
+import logging
+import sys
+import io
DEAMON_ORG = 'org.mageia.Magiback'
DEAMON_INTERFACE = DEAMON_ORG
ISODUMPER_INTERFACE = DEAMON_ORG + ".Isodumper"
+logging.basicConfig(filename="/var/log/magiback.log",level=logging.DEBUG)
class Isodumper(raw_write.Dumper):
"""
@@ -46,7 +51,12 @@ class Isodumper(raw_write.Dumper):
"""
def __init__(self):
super().__init__()
+ APP="isodumper"
+ DIR="/usr/share/locale"
+ # Call translation catalog
+ gettext.install(APP, localedir=DIR,)
self.finished = threading.Event()
+ self.finished.clear()
self._progress = 0
self.loop = GLib.MainLoop()
self.return_state = False
@@ -55,10 +65,11 @@ class Isodumper(raw_write.Dumper):
self.authorized_sender_write = set()
def do_write(self,source, target, size, dbus_context):
+ self.finished.clear()
if check_permission('org.mageia.Magiback.Isodumper.write',dbus_context):
- self.finished.clear()
self.thread = threading.Thread(target=self._do_write, args=(source, target, size, ))
self.thread.start()
+ logging.debug("Writing thread started")
else:
self.return_message = "Access denied"
self.finished.set()
@@ -146,7 +157,6 @@ class ConfFile(object):
if __name__ == '__main__':
print("Running Magiback service.")
-
bus = SystemBus()
conf_file = ConfFile()
bus.publish(DEAMON_ORG, conf_file,