core: use of the new core.log module:

/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
This commit is contained in:
Goffi 2014-04-19 19:19:19 +02:00
commit 501bc92528

View file

@ -20,7 +20,8 @@
from sat.core.i18n import _
from bridge_frontend import BridgeFrontend
import dbus
from logging import debug, error
from sat.core.log import getLogger
log = getLogger(__name__)
from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError
from dbus.mainloop.glib import DBusGMainLoop
@ -47,7 +48,7 @@ class DBusBridgeFrontend(BridgeFrontend):
if e._dbus_error_name == 'org.freedesktop.DBus.Error.ServiceUnknown':
raise BridgeExceptionNoService
elif e._dbus_error_name == 'org.freedesktop.DBus.Error.NotSupported':
print u"D-Bus is not launched, please see README to see instructions on how to launch it"
log.error(_(u"D-Bus is not launched, please see README to see instructions on how to launch it"))
raise BridgeInitError
else:
raise e
@ -59,7 +60,7 @@ class DBusBridgeFrontend(BridgeFrontend):
elif iface == "plugin":
self.db_plugin_iface.connect_to_signal(functionName, handler)
else:
error(_('Unknown interface'))
log.error(_('Unknown interface'))
def __getattribute__(self, name):
""" usual __getattribute__ if the method exists, else try to find a plugin method """