Ejemplo n.º 1
0
def initialize_log_listener(logging_queue):
    global LOGGER
    LOGGER = init_logging(MAIN_LOGGER_NAME)

    # This will move all handlers from LOGGER to the queue listener
    log_listener = setup_log_queue_listener(LOGGER, logging_queue)

    return log_listener
Ejemplo n.º 2
0
def delayed_log_setup():
    from modules.utils.log import init_logging
    global LOGGER
    LOGGER = init_logging(__name__)
Ejemplo n.º 3
0
from PySide2.QtCore import Qt
from lxml import etree

from modules.pos_schnuffi_msg import Msg
from modules.pos_schnuffi_xml_diff import PosXml
from modules.utils.gui_utils import iterate_widget_items_flat, XmlHelper
from modules.utils.language import get_translation
from modules.utils.log import init_logging
from modules.utils.settings import KnechtSettings

# translate strings
lang = get_translation()
lang.install()
_ = lang.gettext

LOGGER = init_logging(__name__)


class ExportActionList(object):
    xml_dom = {'root': 'stateMachine', 'sub_lvl_1': 'stateEngine'}
    err_msg = Msg.POS_ERR_MSG_LS

    def __init__(self, pos_app, pos_ui):
        """ Export selected items as Xml ActionList """
        self.pos_app, self.pos_ui = pos_app, pos_ui
        self.err = self.pos_app.err_sig

    def _prepare_export(self):
        widget = self._get_widget()
        if not widget:
            self.err.emit(self.err_msg[0])
Ejemplo n.º 4
0
import logging
import multiprocessing
import sys

from modules import logging_queue
from modules.main_app import ViewerApp
from modules.utils.globals import FROZEN, MAIN_LOGGER_NAME, Resource
from modules.utils.gui_utils import KnechtExceptionHook
from modules.utils.log import init_logging, setup_log_queue_listener
from modules.utils.settings import KnechtSettings, delayed_log_setup
from ui import viewer_resource

VERSION = '1.46'
LOGGER = init_logging(MAIN_LOGGER_NAME)


def shutdown(local_log_listener):
    #
    # ---- CleanUp ----
    # We do this just to prevent the IDE from deleting the imports
    viewer_resource.qCleanupResources()

    # Shutdown logging and remove handlers
    LOGGER.info('Shutting down log queue listener and logging module.')

    local_log_listener.stop()
    logging.shutdown()


def main():
    multiprocessing.freeze_support()