From 6851d7dfbf8f3adc914495649a4604b0850124eb Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sat, 13 Jun 2020 08:18:14 +0200 Subject: Suppress YUI log from console (mga#26681) also with the launcher Move version in Makefile : use 'make version' to have it in lib/version.py --- lib/isodumper.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/isodumper.py b/lib/isodumper.py index 984d037..b135a75 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -28,6 +28,10 @@ # ensure we're using the latest build, if called from our build environment import sys import importlib +try: + from isodumper import version +except: + import version sys.path.insert(0,'../../../build/swig/python3') importlib.reload(sys) @@ -37,10 +41,6 @@ importlib.reload(sys) import yui import time -#log = yui.YUILog.instance() -#log.setLogFileName("isodumper.log") -#log.enableDebugLogging( True ) - import os import re import gettext @@ -51,7 +51,6 @@ from gi.repository import GLib import psutil import manatools.args as args -RELEASE="v1.17" class NoUDisks2(Exception): @@ -506,7 +505,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") + " " + RELEASE) + yui.YUI.app().setApplicationTitle(_("IsoDumper") + " " + version.RELEASE) yui.YUI.app().setApplicationIcon("/usr/share/icons/isodumper.png") self.atelier = yui.YUI.widgetFactory() self.dialog = self.atelier.createPopupDialog() @@ -679,7 +678,7 @@ exFAT, NTFS or ext. You can specify a volume name and the format in a new dialog def aboutDialog(self): yui.YUI.widgetFactory; mgafactory = yui.YMGAWidgetFactory.getYMGAWidgetFactory(yui.YExternalWidgets.externalWidgetFactory("mga")) - dlg = mgafactory.createAboutDialog("Isodumper", self.RELEASE, "GPLv2", + dlg = mgafactory.createAboutDialog("Isodumper", version.RELEASE, "GPLv2", _("Oliver Grawert
Papoteur
Pictures : Timothée Giet"), _("A tool for writing ISO images to a device")+"
http://gitweb.mageia.org/software/isodumper", "") dlg.show(); @@ -772,10 +771,10 @@ 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") + log = yui.YUILog.setLogFileName("/dev/null") parser = ParseCLI('isodumper') if parser.args.version: - print(RELEASE) + print(version.RELEASE) else: app = IsoDumper() app.run() -- cgit v1.2.1