本文整理汇总了Python中Manager.Manager.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python Manager.destroy方法的具体用法?Python Manager.destroy怎么用?Python Manager.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager.Manager
的用法示例。
在下文中一共展示了Manager.destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Trigger
# 需要导入模块: from Manager import Manager [as 别名]
# 或者: from Manager.Manager import destroy [as 别名]
class Trigger(SignalManager, TriggerManager):
def __init__(self, editor):
SignalManager.__init__(self)
TriggerManager.__init__(self, editor)
self.__init_attributes(editor)
self.connect(self.__trigger, "activate", self.__show_cb)
def __init_attributes(self, editor):
self.__editor = editor
from Manager import Manager
self.__manager = Manager(editor)
from MenuItem import MenuItem
self.__menuitem = MenuItem(editor)
self.__trigger = self.create_trigger("show-autoreplace-dialog")
return
def __show_cb(self, *args):
self.__manager.show()
return
def destroy(self):
self.disconnect()
self.remove_triggers()
self.__menuitem.destroy()
self.__manager.destroy()
del self
return
示例2: Trigger
# 需要导入模块: from Manager import Manager [as 别名]
# 或者: from Manager.Manager import destroy [as 别名]
class Trigger(SignalManager, TriggerManager):
def __init__(self, editor):
SignalManager.__init__(self)
TriggerManager.__init__(self, editor)
self.__init_attributes(editor)
self.connect(self.__trigger, "activate", self.__activate_cb)
def __init_attributes(self, editor):
self.__editor = editor
self.__manager = None
name, shortcut, description, category = (
"toggle-comments",
"<alt>c",
_("Toggle comments"),
_("Line Operations")
)
self.__trigger = self.create_trigger(name, shortcut, description, category)
return
def __get_manager(self):
if self.__manager: return self.__manager
from Manager import Manager
self.__manager = Manager(self.__editor)
return self.__manager
def __activate(self):
if self.__editor.readonly: return False
self.__get_manager().activate()
return False
def __activate_cb(self, *args):
from gobject import idle_add
idle_add(self.__activate)
return False
def __destroy(self):
self.disconnect()
self.remove_triggers()
if self.__manager: self.__manager.destroy()
del self
return False
def destroy(self):
from gobject import idle_add
idle_add(self.__destroy)
return False