Пример #1
0
    def __init__(self, *args):
        BaseComponents.BlissWidget.__init__(self, *args)

        # Layout
        self._status_bar_widget = LogBarWidget(self)
        main_layout = qt.QHBoxLayout(self)
        main_layout.addWidget(self._status_bar_widget)

        self.setSizePolicy(qt.QSizePolicy.MinimumExpanding, 
                           qt.QSizePolicy.Fixed)

        GUILogHandler.GUILogHandler().register(self)
        logger = logging.getLogger("user_level_log")
        logger.info('Ready')
Пример #2
0
import os
import logging
from optparse import OptionParser
import traceback
from qt import *

import BlissFramework
from BlissFramework import GUISupervisor
from BlissFramework.Utils import ErrorHandler
from BlissFramework.Utils import terminal_server
from BlissFramework.Utils import GUILogHandler

from HardwareRepository import HardwareRepository

_logger = logging.getLogger()
_GUIhdlr = GUILogHandler.GUILogHandler()
_logger.addHandler(_GUIhdlr)


def do_gevent():
    # can't call gevent.run inside inner event loops (message boxes...)
    if qApp.loopLevel() == 1:
        try:
            gevent.wait(timeout=0.01)
        except AssertionError:
            pass
    else:
        # all that I tried with gevent here fails! => seg fault
        pass

Пример #3
0
    def __init__(self, *args):
        BaseComponents.BlissWidget.__init__(self, *args)

        self.addProperty('level', 'combo',
                         ('NOT SET', 'INFO', 'WARNING', 'ERROR'), 'NOT SET')
        self.addProperty('showDebug', 'boolean', True)
        self.addProperty('appearance', 'combo', ('list', 'tabs'), 'list')
        self.addProperty('enableFeedback', 'boolean', True)
        self.addProperty('emailAddresses', 'string', '')
        self.addProperty('icons', 'string', '')
        self.addProperty('maxLogLines', 'integer', -1)
        self.addProperty('autoSwitchTabs', 'boolean', False)
        self.addProperty('myTabLabel', 'string', '')

        self.defineSlot('clearLog', ())
        self.defineSlot('tabSelected', ())

        self.defineSignal('incUnreadMessages', ())
        self.defineSignal('resetUnreadMessages', ())

        self.color = {
            logging.NOTSET: 'lightgrey',
            logging.DEBUG: 'darkgreen',
            logging.INFO: 'darkblue',
            logging.WARNING: 'orange',
            logging.ERROR: 'red',
            logging.CRITICAL: 'black'
        }
        self.filterLevel = logging.NOTSET

        self.tabs = QTabWidget(self)
        self.tabs.hide()

        for l in LogViewBrick.LOGS:
            if l == "Feedback":
                self.FeedbackLog = SubmitFeedback(
                    self, LogViewBrick.TITLES["Feedback"],
                    self['emailAddresses'])
            else:
                list_view = LogView(self, LogViewBrick.TITLES[l])
                exec("self.%sLog = list_view" % l)

        for l in LogViewBrick.LOGS[1:]:
            exec("self.%sLog.hide()" % l)

        self.tabLevels = {
            logging.NOTSET: self.InfoLog,
            logging.DEBUG: self.InfoLog,
            logging.INFO: self.InfoLog,
            logging.WARNING: self.InfoLog,
            logging.ERROR: self.InfoLog,
            logging.CRITICAL: self.InfoLog
        }

        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)

        QVBoxLayout(self)
        self.layout().addWidget(self.InfoLog)

        # Register to GUI log handler
        GUILogHandler.GUILogHandler().register(self)
Пример #4
0
    def __init__(self, *args):
        BaseComponents.BlissWidget.__init__(self, *args)

        self.addProperty("level", "combo",
                         ("NOT SET", "INFO", "WARNING", "ERROR"), "NOT SET")
        self.addProperty("showDebug", "boolean", True)
        self.addProperty("appearance", "combo", ("list", "tabs"), "list")
        self.addProperty("enableFeedback", "boolean", True)
        self.addProperty("emailAddresses", "string", "")
        self.addProperty("icons", "string", "")
        self.addProperty("maxLogLines", "integer", -1)
        self.addProperty("autoSwitchTabs", "boolean", False)
        self.addProperty("myTabLabel", "string", "")

        self.defineSlot("clearLog", ())
        self.defineSlot("tabSelected", ())

        self.defineSignal("incUnreadMessages", ())
        self.defineSignal("resetUnreadMessages", ())

        self.color = {
            logging.NOTSET: "lightgrey",
            logging.DEBUG: "darkgreen",
            logging.INFO: "darkblue",
            logging.WARNING: "orange",
            logging.ERROR: "red",
            logging.CRITICAL: "black",
        }
        self.filterLevel = logging.NOTSET

        self.tabs = QTabWidget(self)
        self.tabs.hide()

        for l in LogViewBrick.LOGS:
            if l == "Feedback":
                self.FeedbackLog = SubmitFeedback(
                    self, LogViewBrick.TITLES["Feedback"],
                    self["emailAddresses"])
            else:
                list_view = LogView(self, LogViewBrick.TITLES[l])
                exec("self.%sLog = list_view" % l)

        for l in LogViewBrick.LOGS[1:]:
            exec("self.%sLog.hide()" % l)

        self.tabLevels = {
            logging.NOTSET: self.InfoLog,
            logging.DEBUG: self.InfoLog,
            logging.INFO: self.InfoLog,
            logging.WARNING: self.InfoLog,
            logging.ERROR: self.InfoLog,
            logging.CRITICAL: self.InfoLog,
        }

        self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Expanding)

        QVBoxLayout(self)
        self.layout().addWidget(self.InfoLog)

        # Register to GUI log handler
        GUILogHandler.GUILogHandler().register(self)