Python log 模块,getvalue() 实例源码

我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用log.getvalue()

项目:enigma2    作者:OpenLD    | 项目源码 | 文件源码
def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)
        self.setTitle(_("Positioner setup log"))
        self["key_red"] = Button(_("Exit/OK"))
        self["key_green"] = Button(_("Save"))
        self["key_blue"] = Button(_("Clear"))
        self["list"] = ScrollLabel(log.getvalue())
        self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ColorActions"],
        {
            "red": self.cancel,
            "green": self.save,
            "save": self.save,
            "blue": self.clear,
            "cancel": self.cancel,
            "ok": self.cancel,
            "left": self["list"].pageUp,
            "right": self["list"].pageDown,
            "up": self["list"].pageUp,
            "down": self["list"].pageDown,
            "pageUp": self["list"].pageUp,
            "pageDown": self["list"].pageDown
        }, -2)
项目:enigma2    作者:Openeight    | 项目源码 | 文件源码
def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)
        self.setTitle(_("Positioner setup log"))
        self["key_red"] = Button(_("Exit/OK"))
        self["key_green"] = Button(_("Save"))
        self["key_blue"] = Button(_("Clear"))
        self["list"] = ScrollLabel(log.getvalue())
        self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ColorActions"],
        {
            "red": self.cancel,
            "green": self.save,
            "save": self.save,
            "blue": self.clear,
            "cancel": self.cancel,
            "ok": self.cancel,
            "left": self["list"].pageUp,
            "right": self["list"].pageDown,
            "up": self["list"].pageUp,
            "down": self["list"].pageDown,
            "pageUp": self["list"].pageUp,
            "pageDown": self["list"].pageDown
        }, -2)
项目:enigma2    作者:BlackHole    | 项目源码 | 文件源码
def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)
        self.setTitle(_("Positioner setup log"))
        self["key_red"] = Button(_("Exit/OK"))
        self["key_green"] = Button(_("Save"))
        self["key_blue"] = Button(_("Clear"))
        self["list"] = ScrollLabel(log.getvalue())
        self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ColorActions"],
        {
            "red": self.cancel,
            "green": self.save,
            "save": self.save,
            "blue": self.clear,
            "cancel": self.cancel,
            "ok": self.cancel,
            "left": self["list"].pageUp,
            "right": self["list"].pageDown,
            "up": self["list"].pageUp,
            "down": self["list"].pageDown,
            "pageUp": self["list"].pageUp,
            "pageDown": self["list"].pageDown
        }, -2)
项目:AutoBouquetsMaker    作者:oe-alliance    | 项目源码 | 文件源码
def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)
        Screen.setTitle(self, _("AutoBouquetsMaker Log"))
        self["list"] = ScrollLabel(log.getvalue())
        self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions", "MenuActions"],
        {
            "cancel": self.cancel,
            "ok": self.cancel,
            "up": self["list"].pageUp,
            "down": self["list"].pageDown,
            "menu": self.closeRecursive,
            "green": self.save,
        }, -2)

        self["key_green"] = Button(_("Save Log"))
        self["key_red"] = Button(_("Close"))
项目:enigma2-openpli-fulan    作者:Taapat    | 项目源码 | 文件源码
def __init__(self, session):
        self.session = session
        Screen.__init__(self, session)
        self.setTitle(_("Positioner setup log"))
        self["key_red"] = Button(_("Exit/OK"))
        self["key_green"] = Button(_("Save"))
        self["key_blue"] = Button(_("Clear"))
        self["list"] = ScrollLabel(log.getvalue())
        self["actions"] = ActionMap(["DirectionActions", "OkCancelActions", "ColorActions"],
        {
            "red": self.cancel,
            "green": self.save,
            "save": self.save,
            "blue": self.clear,
            "cancel": self.cancel,
            "ok": self.cancel,
            "left": self["list"].pageUp,
            "right": self["list"].pageDown,
            "up": self["list"].pageUp,
            "down": self["list"].pageDown,
            "pageUp": self["list"].pageUp,
            "pageDown": self["list"].pageDown
        }, -2)
项目:enigma2    作者:OpenLD    | 项目源码 | 文件源码
def save(self):
        try:
            f = open('/tmp/positionersetup.log', 'w')
            f.write(log.getvalue())
            f.close()
            self.session.open(MessageBox, _("Write to /tmp/positionersetup.log"), MessageBox.TYPE_INFO, timeout = 5)
        except Exception, e:
            self["list"].setText(_("Failed to write /tmp/positionersetup.log: ") + str(e))
        self.close(True)
项目:enigma2    作者:Openeight    | 项目源码 | 文件源码
def save(self):
        try:
            f = open('/tmp/positionersetup.log', 'w')
            f.write(log.getvalue())
            f.close()
            self.session.open(MessageBox, _("Write to /tmp/positionersetup.log"), MessageBox.TYPE_INFO, timeout = 5)
        except Exception, e:
            self["list"].setText(_("Failed to write /tmp/positionersetup.log: ") + str(e))
        self.close(True)
项目:enigma2    作者:BlackHole    | 项目源码 | 文件源码
def save(self):
        try:
            f = open('/tmp/positionersetup.log', 'w')
            f.write(log.getvalue())
            f.close()
            self.session.open(MessageBox, _("Write to /tmp/positionersetup.log"), MessageBox.TYPE_INFO, timeout = 5)
        except Exception, e:
            self["list"].setText(_("Failed to write /tmp/positionersetup.log: ") + str(e))
        self.close(True)
项目:AutoBouquetsMaker    作者:oe-alliance    | 项目源码 | 文件源码
def save(self):
        output = open('/tmp/abm.log', 'w')
        output.write(log.getvalue())
        output.close()
        self.session.open(MessageBox,_("ABM log file has been saved to the tmp directory"),MessageBox.TYPE_INFO, timeout = 45)
项目:enigma2-openpli-fulan    作者:Taapat    | 项目源码 | 文件源码
def save(self):
        try:
            f = open('/tmp/positionersetup.log', 'w')
            f.write(log.getvalue())
            f.close()
            self.session.open(MessageBox, _("Write to /tmp/positionersetup.log"), MessageBox.TYPE_INFO, timeout = 5)
        except Exception, e:
            self["list"].setText(_("Failed to write /tmp/positionersetup.log: ") + str(e))
        self.close(True)