diff --git a/openlp.pyw b/openlp.pyw index 5c18486b6..31869e797 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -59,13 +59,13 @@ QToolBar padding: 0; } """ +log = logging.getLogger(__name__) class OpenLP(QtGui.QApplication): """ The core application class. This class inherits from Qt's QApplication class in order to provide the core of the application. """ - global log log.info(u'OpenLP Application Loaded') def notify(self, obj, evt): diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 9bd7cd652..be7dff67a 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -27,6 +27,8 @@ import logging from PyQt4 import QtCore +log = logging.getLogger(__name__) + class EventReceiver(QtCore.QObject): """ Class to allow events to be passed from different parts of the @@ -108,9 +110,6 @@ class EventReceiver(QtCore.QObject): Informs all components of the presentation types supported. """ - global log - log = logging.getLogger(u'EventReceiver') - def __init__(self): """ Initialise the event receiver, calling the parent constructor. diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 5f490eed1..ff87f0b0d 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -32,6 +32,8 @@ from openlp.core.lib.toolbar import * from openlp.core.lib import contextMenuAction, contextMenuSeparator from serviceitem import ServiceItem +log = logging.getLogger(__name__) + class MediaManagerItem(QtGui.QWidget): """ MediaManagerItem is a helper widget for plugins. @@ -92,9 +94,6 @@ class MediaManagerItem(QtGui.QWidget): method is not defined, a default will be used (treat the filename as an image). """ - - global log - log = logging.getLogger(u'MediaManagerItem') log.info(u'Media Item loaded') def __init__(self, parent=None, icon=None, title=None): diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index ca291d578..e15369145 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -28,6 +28,8 @@ from PyQt4 import QtCore from openlp.core.lib import PluginConfig, Receiver +log = logging.getLogger(__name__) + class PluginStatus(object): """ Defines the status of the plugin @@ -88,8 +90,6 @@ class Plugin(QtCore.QObject): Used in the plugin manager, when a person clicks on the 'About' button. """ - global log - log = logging.getLogger(u'Plugin') log.info(u'loaded') def __init__(self, name, version=None, plugin_helpers=None): diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index b06f23953..2ea5751ec 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -29,13 +29,13 @@ import logging from openlp.core.lib import Plugin, PluginStatus +log = logging.getLogger(__name__) + class PluginManager(object): """ This is the Plugin manager, which loads all the plugins, and executes all the hooks, as and when necessary. """ - global log - log = logging.getLogger(u'PluginMgr') log.info(u'Plugin manager loaded') def __init__(self, dir): diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index cc976dae5..ea6e849d8 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -28,13 +28,13 @@ import logging from PyQt4 import QtGui, QtCore from openlp.core.lib import resize_image +log = logging.getLogger(__name__) + class Renderer(object): """ Genarates a pixmap image of a array of text. The Text is formatted to make sure it fits on the screen and if not extra frames are generated. """ - global log - log = logging.getLogger(u'Renderer') log.info(u'Renderer Loaded') def __init__(self): diff --git a/openlp/core/lib/rendermanager.py b/openlp/core/lib/rendermanager.py index 1e8363228..edab3d309 100644 --- a/openlp/core/lib/rendermanager.py +++ b/openlp/core/lib/rendermanager.py @@ -30,6 +30,8 @@ from PyQt4 import QtCore from renderer import Renderer from openlp.core.lib import ThemeLevel +log = logging.getLogger(__name__) + class RenderManager(object): """ Class to pull all Renderer interactions into one place. The plugins will @@ -45,8 +47,6 @@ class RenderManager(object): ``screen_number`` Defaults to *0*. The index of the output/display screen. """ - global log - log = logging.getLogger(u'RenderManager') log.info(u'RenderManager Loaded') def __init__(self, theme_manager, screens, screen_number=0): diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index e62b24d8e..52deafc06 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -32,6 +32,8 @@ from PyQt4 import QtGui from openlp.core.lib import build_icon, Receiver, resize_image +log = logging.getLogger(__name__) + class ServiceItemType(object): """ Defines the type of service item @@ -46,8 +48,6 @@ class ServiceItem(object): the service manager, the slide controller, and the projection screen compositor. """ - global log - log = logging.getLogger(u'ServiceItem') log.info(u'Service Item created') def __init__(self, plugin=None): diff --git a/openlp/core/lib/songxmlhandler.py b/openlp/core/lib/songxmlhandler.py index 596866934..7a532970d 100644 --- a/openlp/core/lib/songxmlhandler.py +++ b/openlp/core/lib/songxmlhandler.py @@ -27,6 +27,8 @@ import logging from xml.dom.minidom import Document from xml.etree.ElementTree import ElementTree, XML, dump +log = logging.getLogger(__name__) + class SongXMLBuilder(object): """ This class builds the XML used to describe songs. @@ -42,8 +44,6 @@ class SongXMLBuilder(object): """ - global log - log = logging.getLogger(u'SongXMLBuilder') log.info(u'SongXMLBuilder Loaded') def __init__(self): @@ -123,8 +123,6 @@ class SongXMLParser(object): """ - global log - log = logging.getLogger(u'SongXMLParser') log.info(u'SongXMLParser Loaded') def __init__(self, xml): @@ -158,4 +156,4 @@ class SongXMLParser(object): """ Debugging aid to dump XML so that we can see what we have. """ - return dump(self.song_xml) \ No newline at end of file + return dump(self.song_xml) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index bdb396498..87935cf5e 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -31,13 +31,13 @@ from PyQt4.phonon import Phonon from openlp.core.lib import Receiver, resize_image +log = logging.getLogger(__name__) + class DisplayWidget(QtGui.QWidget): """ Customised version of QTableWidget which can respond to keyboard events. """ - global log - log = logging.getLogger(u'MainDisplay') log.info(u'MainDisplay loaded') def __init__(self, parent=None, name=None): @@ -78,8 +78,6 @@ class MainDisplay(DisplayWidget): """ This is the form that is used to display things on the projector. """ - global log - log = logging.getLogger(u'MainDisplay') log.info(u'MainDisplay Loaded') def __init__(self, parent, screens): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 96a089df1..7e822fb8a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -36,6 +36,8 @@ from openlp.core.lib import RenderManager, PluginConfig, build_icon, \ OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool from openlp.core.utils import check_latest_version +log = logging.getLogger(__name__) + media_manager_style = """ QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, @@ -420,8 +422,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ The main window. """ - global log - log = logging.getLogger(u'MainWindow') log.info(u'MainWindow loaded') def __init__(self, screens, applicationVersion): diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index fa48c0723..9af8b7ca3 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -30,9 +30,9 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib.plugin import PluginStatus from plugindialog import Ui_PluginViewDialog +log = logging.getLogger(__name__) + class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): - global log - log = logging.getLogger(u'PluginForm') def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) @@ -126,4 +126,4 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): elif self.activePlugin.status == PluginStatus.Disabled: status_text = 'Disabled' self.PluginListWidget.currentItem().setText( - u'%s (%s)' % (self.activePlugin.name, status_text)) \ No newline at end of file + u'%s (%s)' % (self.activePlugin.name, status_text)) diff --git a/openlp/core/ui/screen.py b/openlp/core/ui/screen.py index 2321c3020..9fad9ca9b 100644 --- a/openlp/core/ui/screen.py +++ b/openlp/core/ui/screen.py @@ -24,12 +24,12 @@ ############################################################################### import logging +log = logging.getLogger(__name__) + class ScreenList(object): """ Wrapper to handle the parameters of the display screen """ - global log - log = logging.getLogger(u'Screen') log.info(u'Screen loaded') def __init__(self): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 22fbb7ecc..f13cca760 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -28,6 +28,8 @@ import logging import cPickle import zipfile +log = logging.getLogger(__name__) + from PyQt4 import QtCore, QtGui from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ contextMenuAction, contextMenuSeparator, contextMenu, Receiver, \ @@ -105,9 +107,6 @@ class ServiceManager(QtGui.QWidget): the resources used into one OSZ file for use on any OpenLP v2 installation. Also handles the UI tasks of moving things up and down etc. """ - global log - log = logging.getLogger(u'ServiceManager') - def __init__(self, parent): """ Sets up the service manager, toolbars, list view, et al. diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 515fb2d3c..81ff030ae 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -33,6 +33,8 @@ from PyQt4.phonon import Phonon from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, \ PluginConfig, resize_image +log = logging.getLogger(__name__) + class SlideList(QtGui.QTableWidget): """ Customised version of QTableWidget which can respond to keyboard @@ -74,9 +76,6 @@ class SlideController(QtGui.QWidget): SlideController is the slide controller widget. This widget is what the user uses to control the displaying of verses/slides/etc on the screen. """ - global log - log = logging.getLogger(u'SlideController') - def __init__(self, parent, settingsmanager, isLive=False): """ Set up the Slide Controller. diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 577021418..ba541aa6e 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -38,13 +38,12 @@ from openlp.core.lib import PluginConfig, OpenLPToolbar, contextMenuAction, \ contextMenuSeparator from openlp.core.utils import ConfigHelper +log = logging.getLogger(__name__) + class ThemeManager(QtGui.QWidget): """ Manages the orders of Theme. """ - global log - log = logging.getLogger(u'ThemeManager') - def __init__(self, parent): QtGui.QWidget.__init__(self, parent) self.parent = parent diff --git a/openlp/migration/display.py b/openlp/migration/display.py index 9a3f6e44e..bffef5b17 100644 --- a/openlp/migration/display.py +++ b/openlp/migration/display.py @@ -25,9 +25,9 @@ import logging +log = logging.getLogger(__name__) + class Display(): - global log - log = logging.getLogger(u'Display Logger') log.info(u'Display Class loaded') @staticmethod @@ -39,4 +39,4 @@ class Display(): def sub_output(string): if not string is None: log.debug(u' '+string); - print (u' '+string) \ No newline at end of file + print (u' '+string) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 5bf268394..3e065f6af 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -31,9 +31,9 @@ from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.alerts.lib import AlertsManager, DBManager from openlp.plugins.alerts.forms import AlertsTab, AlertForm, AlertEditForm +log = logging.getLogger(__name__) + class alertsPlugin(Plugin): - global log - log = logging.getLogger(u'AlertsPlugin') log.info(u'Alerts Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index deda11240..6838fefa0 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -29,12 +29,12 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver +log = logging.getLogger(__name__) + class AlertsManager(QtCore.QObject): """ - BiblesTab is the Bibles settings tab in the settings dialog. + AlertsTab is the Alerts settings tab in the settings dialog. """ - global log - log = logging.getLogger(u'AlertManager') log.info(u'Alert Manager loaded') def __init__(self, parent): diff --git a/openlp/plugins/alerts/lib/manager.py b/openlp/plugins/alerts/lib/manager.py index 3480b3103..a3ed1ee7e 100644 --- a/openlp/plugins/alerts/lib/manager.py +++ b/openlp/plugins/alerts/lib/manager.py @@ -27,14 +27,13 @@ import logging from openlp.plugins.alerts.lib.models import init_models, metadata, AlertItem +log = logging.getLogger(__name__) + class DBManager(): """ The Song Manager provides a central location for all database code. This class takes care of connecting to the database and running all the queries. """ - - global log - log = logging.getLogger(u'AlertsDBManager') log.info(u'Alerts DB loaded') def __init__(self, config): diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 9d85a90a0..8cf15e942 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -30,9 +30,9 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem +log = logging.getLogger(__name__) + class BiblePlugin(Plugin): - global log - log = logging.getLogger(u'BiblePlugin') log.info(u'Bible Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 2f5e84867..dfca754a8 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -34,6 +34,8 @@ from bibleimportwizard import Ui_BibleImportWizard from openlp.core.lib import Receiver from openlp.plugins.bibles.lib.manager import BibleFormat +log = logging.getLogger(__name__) + class DownloadLocation(object): Unknown = -1 Crosswalk = 0 @@ -54,9 +56,6 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): This is the Bible Import Wizard, which allows easy importing of Bibles into OpenLP from other formats like OSIS, CSV and OpenSong. """ - - global log - log = logging.getLogger(u'BibleImportForm') log.info(u'BibleImportForm loaded') def __init__(self, parent, config, manager, bibleplugin): @@ -371,4 +370,4 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.ImportProgressBar.setValue(self.ImportProgressBar.maximum()) self.finishButton.setVisible(True) self.cancelButton.setVisible(False) - Receiver.send_message(u'process_events') \ No newline at end of file + Receiver.send_message(u'process_events') diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index ef8e6a090..398040fd8 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -29,12 +29,12 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import str_to_bool, Receiver, SettingsTab +log = logging.getLogger(__name__) + class BiblesTab(SettingsTab): """ BiblesTab is the Bibles settings tab in the settings dialog. """ - global log - log = logging.getLogger(u'BibleTab') log.info(u'Bible Tab loaded') def __init__(self, title, section=None): diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index 965d0433f..d24982532 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -33,6 +33,8 @@ from csvbible import CSVBible from db import BibleDB from http import HTTPBible +log = logging.getLogger(__name__) + class BibleMode(object): """ This is basically an enumeration class which specifies the mode of a Bible. @@ -85,8 +87,6 @@ class BibleManager(object): """ The Bible manager which holds and manages all the Bibles. """ - global log - log = logging.getLogger(u'BibleManager') log.info(u'Bible manager loaded') def __init__(self, parent, config): diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index c0a3bde35..30403e69d 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -32,6 +32,8 @@ from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \ BaseListWithDnD from openlp.plugins.bibles.forms import ImportWizardForm +log = logging.getLogger(__name__) + class BibleListView(BaseListWithDnD): """ Drag and drop capable list for Bibles. @@ -47,8 +49,6 @@ class BibleMediaItem(MediaManagerItem): """ This is the custom media manager item for Bibles. """ - global log - log = logging.getLogger(u'BibleMediaItem') log.info(u'Bible Media Item loaded') def __init__(self, parent, icon, title): diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index cfa68b213..6498e4d34 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -33,12 +33,12 @@ import re from openlp.core.lib import Receiver from db import BibleDB +log = logging.getLogger(__name__) + class OSISBible(BibleDB): """ OSIS Bible format importer class. """ - global log - log = logging.getLogger(u'BibleOSISImpl') log.info(u'BibleOSISImpl loaded') def __init__(self, parent, **kwargs): diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index fb30bed9f..3e21228df 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -29,6 +29,7 @@ from forms import EditCustomForm from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab +log = logging.getLogger(__name__) class CustomPlugin(Plugin): """ @@ -39,9 +40,6 @@ class CustomPlugin(Plugin): the songs plugin has become restrictive. Examples could be Welcome slides, Bible Reading information, Orders of service. """ - - global log - log = logging.getLogger(u'CustomPlugin') log.info(u'Custom Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index e701c0938..577142f23 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -30,12 +30,12 @@ from editcustomdialog import Ui_customEditDialog from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver from openlp.plugins.custom.lib.models import CustomSlide +log = logging.getLogger(__name__) + class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): """ Class documentation goes here. """ - global log - log = logging.getLogger(u'EditCustomForm') log.info(u'Custom Editor loaded') def __init__(self, custommanager, parent = None): """ diff --git a/openlp/plugins/custom/lib/manager.py b/openlp/plugins/custom/lib/manager.py index d1d3e0349..e88e72b5c 100644 --- a/openlp/plugins/custom/lib/manager.py +++ b/openlp/plugins/custom/lib/manager.py @@ -27,14 +27,13 @@ import logging from openlp.plugins.custom.lib.models import init_models, metadata, CustomSlide +log = logging.getLogger(__name__) + class CustomManager(): """ The Song Manager provides a central location for all database code. This class takes care of connecting to the database and running all the queries. """ - - global log - log = logging.getLogger(u'CustomManager') log.info(u'Custom manager loaded') def __init__(self, config): diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index c4b9ef16a..2a3090cf2 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -30,6 +30,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD,\ Receiver, str_to_bool +log = logging.getLogger(__name__) + class CustomListView(BaseListWithDnD): def __init__(self, parent=None): self.PluginName = u'Custom' @@ -39,8 +41,6 @@ class CustomMediaItem(MediaManagerItem): """ This is the custom media manager item for Custom Slides. """ - global log - log = logging.getLogger(u'CustomMediaItem') log.info(u'Custom Media Item loaded') def __init__(self, parent, icon, title): diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index e6895c767..40e9c1e1d 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -28,9 +28,9 @@ import logging from openlp.core.lib import Plugin, build_icon, PluginStatus from openlp.plugins.images.lib import ImageMediaItem, ImageTab +log = logging.getLogger(__name__) + class ImagePlugin(Plugin): - global log - log = logging.getLogger(u'ImagePlugin') log.info(u'Image Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index e418ee44e..830459843 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -29,6 +29,8 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon +log = logging.getLogger(__name__) + # We have to explicitly create separate classes for each plugin # in order for DnD to the Service manager to work correctly. class ImageListView(BaseListWithDnD): @@ -40,8 +42,6 @@ class ImageMediaItem(MediaManagerItem): """ This is the custom media manager item for images. """ - global log - log = logging.getLogger(u'ImageMediaItem') log.info(u'Image Media Item loaded') def __init__(self, parent, icon, title): diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 31b3ac5f6..0ea5c4d3a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -46,15 +46,15 @@ from PyQt4 import QtCore from presentationcontroller import PresentationController +log = logging.getLogger(__name__) + class ImpressController(PresentationController): """ Class to control interactions with Impress presentations. It creates the runtime environment, loads and closes the presentation as well as triggering the correct activities based on the users input """ - global log - log = logging.getLogger(u'ImpressController') - log.info(u'loaded') + log.info(u'ImpressController loaded') def __init__(self, plugin): """ diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 590074ead..90487cdf5 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -31,6 +31,8 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD from openlp.plugins.presentations.lib import MessageListener +log = logging.getLogger(__name__) + # We have to explicitly create separate classes for each plugin # in order for DnD to the Service manager to work correctly. class PresentationListView(BaseListWithDnD): @@ -43,8 +45,6 @@ class PresentationMediaItem(MediaManagerItem): This is the Presentation media manager item for Presentation Items. It can present files using Openoffice """ - global log - log = logging.getLogger(u'PresentationsMediaItem') log.info(u'Presentations Media Item loaded') def __init__(self, parent, icon, title, controllers): diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 3c665004b..5d4bef4db 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -30,13 +30,13 @@ from PyQt4 import QtCore from openlp.core.lib import Receiver +log = logging.getLogger(__name__) + class Controller(object): """ This is the Presentation listener who acts on events from the slide controller and passes the messages on the the correct presentation handlers """ - global log - log = logging.getLogger(u'Controller') log.info(u'Controller loaded') def __init__(self, live): @@ -149,8 +149,6 @@ class MessageListener(object): This is the Presentation listener who acts on events from the slide controller and passes the messages on the the correct presentation handlers """ - global log - log = logging.getLogger(u'MessageListener') log.info(u'Message Listener loaded') def __init__(self, controllers): diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index a9775e086..42bc160de 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -33,6 +33,8 @@ if os.name == u'nt': from presentationcontroller import PresentationController +log = logging.getLogger(__name__) + # PPT API documentation: # http://msdn.microsoft.com/en-us/library/aa269321(office.10).aspx @@ -42,9 +44,7 @@ class PowerpointController(PresentationController): It creates the runtime Environment , Loads the and Closes the Presentation As well as triggering the correct activities based on the users input """ - global log - log = logging.getLogger(u'PowerpointController') - log.info(u'loaded') + log.info(u'PowerpointController loaded') def __init__(self, plugin): """ diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 2ed457fc0..ddfa5ab7a 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -32,15 +32,15 @@ if os.name == u'nt': from presentationcontroller import PresentationController +log = logging.getLogger(__name__) + class PptviewController(PresentationController): """ Class to control interactions with PowerPOint Viewer Presentations It creates the runtime Environment , Loads the and Closes the Presentation As well as triggering the correct activities based on the users input """ - global log - log = logging.getLogger(u'PptviewController') - log.info(u'loaded') + log.info(u'PPTViewController loaded') def __init__(self, plugin): """ diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index db42a482d..b0f3e4e79 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -31,6 +31,8 @@ from PyQt4 import QtCore from openlp.core.lib import Receiver +log = logging.getLogger(__name__) + class PresentationController(object): """ Base class for presentation controllers to inherit from @@ -116,8 +118,6 @@ class PresentationController(object): Returns a path to an image containing a preview for the requested slide """ - global log - log = logging.getLogger(u'PresentationController') log.info(u'PresentationController loaded') def __init__(self, plugin=None, name=u'PresentationController'): diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 7103a3a2c..061eb737f 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -29,9 +29,9 @@ import logging from openlp.core.lib import Plugin, build_icon, Receiver, PluginStatus from openlp.plugins.presentations.lib import * -class PresentationPlugin(Plugin): +log = logging.getLogger(__name__) - global log +class PresentationPlugin(Plugin): log = logging.getLogger(u'PresentationPlugin') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index bd8d8974b..acfa6f97d 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -30,10 +30,9 @@ from PyQt4 import QtNetwork, QtCore from openlp.core.lib import Plugin, Receiver from openlp.plugins.remotes.lib import RemoteTab -class RemotesPlugin(Plugin): +log = logging.getLogger(__name__) - global log - log = logging.getLogger(u'RemotesPlugin') +class RemotesPlugin(Plugin): log.info(u'Remote Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/songs/lib/manager.py b/openlp/plugins/songs/lib/manager.py index ceb596942..74bd4cf82 100644 --- a/openlp/plugins/songs/lib/manager.py +++ b/openlp/plugins/songs/lib/manager.py @@ -28,14 +28,13 @@ import logging from openlp.plugins.songs.lib.models import init_models, metadata, Song, \ Author, Topic, Book +log = logging.getLogger(__name__) + class SongManager(): """ The Song Manager provides a central location for all database code. This class takes care of connecting to the database and running all the queries. """ - - global log - log = logging.getLogger(u'SongManager') log.info(u'Song manager loaded') def __init__(self, config): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 63fd69d48..cd440e54f 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -31,6 +31,8 @@ from openlp.core.lib import MediaManagerItem, SongXMLParser, \ BaseListWithDnD, Receiver, str_to_bool from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm +log = logging.getLogger(__name__) + class SongListView(BaseListWithDnD): def __init__(self, parent=None): self.PluginName = u'Songs' @@ -40,8 +42,6 @@ class SongMediaItem(MediaManagerItem): """ This is the custom media manager item for Songs. """ - global log - log = logging.getLogger(u'SongMediaItem') log.info(u'Song Media Item loaded') def __init__(self, parent, icon, title): diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 088b9a1cf..eb6eb2c2a 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -32,6 +32,8 @@ from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab from openlp.plugins.songs.forms import OpenLPImportForm, OpenSongExportForm, \ OpenSongImportForm, OpenLPExportForm +log = logging.getLogger(__name__) + class SongsPlugin(Plugin): """ This is the number 1 plugin, if importance were placed on any @@ -40,9 +42,6 @@ class SongsPlugin(Plugin): specified. Authors, topics and song books can be assigned to songs as well. """ - - global log - log = logging.getLogger(u'SongsPlugin') log.info(u'Song Plugin loaded') def __init__(self, plugin_helpers): diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index df749d8c0..be548ac35 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -29,9 +29,9 @@ import logging from songusagedetaildialog import Ui_SongUsageDetailDialog +log = logging.getLogger(__name__) + class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): - global log - log = logging.getLogger(u'SongUsageDetailForm') log.info(u'SongUsage Detail Form loaded') """ Class documentation goes here. diff --git a/openlp/plugins/songusage/lib/manager.py b/openlp/plugins/songusage/lib/manager.py index 6cae4c372..d9f7feb6f 100644 --- a/openlp/plugins/songusage/lib/manager.py +++ b/openlp/plugins/songusage/lib/manager.py @@ -27,14 +27,13 @@ import logging from openlp.plugins.songusage.lib.models import init_models, metadata, SongUsageItem +log = logging.getLogger(__name__) + class SongUsageManager(): """ The Song Manager provides a central location for all database code. This class takes care of connecting to the database and running all the queries. """ - - global log - log = logging.getLogger(u'SongUsageManager') log.info(u'SongUsage manager loaded') def __init__(self, config): diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index d0ebe68ef..d30bd4bea 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -33,9 +33,9 @@ from openlp.plugins.songusage.lib import SongUsageManager from openlp.plugins.songusage.forms import SongUsageDetailForm, SongUsageDeleteForm from openlp.plugins.songusage.lib.models import SongUsageItem +log = logging.getLogger(__name__) + class SongUsagePlugin(Plugin): - global log - log = logging.getLogger(u'SongUsagePlugin') log.info(u'SongUsage Plugin loaded') def __init__(self, plugin_helpers):