当前位置: 首页>>代码示例>>Python>>正文


Python urwid.disconnect_signal方法代码示例

本文整理汇总了Python中urwid.disconnect_signal方法的典型用法代码示例。如果您正苦于以下问题:Python urwid.disconnect_signal方法的具体用法?Python urwid.disconnect_signal怎么用?Python urwid.disconnect_signal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在urwid的用法示例。


在下文中一共展示了urwid.disconnect_signal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_aws_changed

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def on_aws_changed(self):
        # aws
        self.aws_view.update_focus()

        # group
        urwid.disconnect_signal(self.group_view.get_walker(), "modified",
                                self.on_group_changed)
        aws_name = self.aws_view.get_selected_name()
        self.group_view.update_widgets(
            list(self.manager.instances[aws_name].keys()))
        urwid.connect_signal(self.group_view.get_walker(), "modified",
                             self.on_group_changed)

        # instance
        group_name = self.group_view.get_selected_name()
        self.instance_view.update_widgets(
            self.manager.instances[aws_name][group_name]) 
开发者ID:leejaycoke,项目名称:ec2-gazua,代码行数:19,代码来源:gazua.py

示例2: _edit_ok

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _edit_ok(self, form, newtext, entry):
        try:
            self.row.update_attribute(self.session, entry.attrname, newtext)
        except:
            ex, val, tb = sys.exc_info()
            self.session.rollback()
            DEBUG(ex.__name__, val)
            self._emit("message", "{}: {}".format(ex.__name__, val))
            return
        urwid.disconnect_signal(form, 'ok', self._edit_ok, entry)
        urwid.disconnect_signal(form, 'cancel', self._edit_cancel, entry)
        saveentry = self._saveentryval
        del self._saveentryval
        newval = self.row.get_attribute(self.session, entry.attrname)
        saveentry.base_widget[1].base_widget.set_text(unicode(newval).encode("utf-8"))
        entry._w = saveentry

    # create attrib 
开发者ID:kdart,项目名称:pycopia,代码行数:20,代码来源:widgets.py

示例3: _add_new_testequipment_ok

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _add_new_testequipment_ok(self, frm, data):
        eq, roles, uut = data
        dbrow = models.create(models.TestEquipment, environment=self.environmentrow, equipment=eq, UUT=uut, roles=roles)
        self.session.add(dbrow)
        try:
            self.session.commit()
        except:
            self.session.rollback()
            ex, val, tb = sys.exc_info()
            DEBUG(ex.__name__, val)
            self._emit("message", "{}: {}".format(ex.__name__, val))
        entry = ListEntry(urwid.Text(self._stringify_te(dbrow)))
        urwid.connect_signal(entry, 'activate', self._edit_testequipment)
        urwid.connect_signal(entry, 'delete', self._delete_testequipment)
        entry.testequipment = dbrow
        listbox = self._w.contents[1][0].base_widget
        listbox.body.append(entry)
        urwid.disconnect_signal(frm, 'ok', self._add_new_testequipment_ok)
        urwid.disconnect_signal(frm, 'cancel', self._add_new_testequipment_cancel)
        frm._emit("popform") 
开发者ID:kdart,项目名称:pycopia,代码行数:22,代码来源:widgets.py

示例4: _delete_ok

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _delete_ok(self, dlg, listentry):
        listbox = self._w.contents[1][0].base_widget
        assert type(listbox) is urwid.ListBox
        listbox.body.remove(listentry)
        urwid.disconnect_signal(dlg, 'ok', self._delete_ok, listentry)
        urwid.disconnect_signal(dlg, 'cancel', self._delete_cancel, listentry)
        del self._oldw
        try:
            self.session.delete(listentry.testequipment)
            self.session.commit()
        except:
            ex, val, tb = sys.exc_info()
            self.session.rollback()
            DEBUG(ex.__name__, val)
            self._emit("message", "{}: {}".format(ex.__name__, val))
        listentry.testequipment = None
        urwid.disconnect_signal(listentry, 'activate', self._edit_testequipment)
        urwid.disconnect_signal(listentry, 'delete', self._delete_testequipment) 
开发者ID:kdart,项目名称:pycopia,代码行数:20,代码来源:widgets.py

示例5: _popform

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _popform(self, form):
        if form is not None:
            urwid.disconnect_signal(form, 'pushform', self._pushform)
            urwid.disconnect_signal(form, 'popform', self._popform)
            urwid.disconnect_signal(form, 'message', self._message)
        if self._formtrail:
            self.form = self._formtrail.pop()
            #self.form.invalidate()
            self.top.body = self.form
        else:
            raise urwid.ExitMainLoop() 
开发者ID:kdart,项目名称:pycopia,代码行数:13,代码来源:main.py

示例6: _runtest

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _runtest(self, b):
        if not self._tclist:
            self._emit("message", "No tests selected")
            return
        urwid.disconnect_signal(b, "click", self._runtest) # prevent running again until test ends
        environmentname = self._envsel.value
        reportname = self._repsel.value
        options = self._get_options()
        testlist = [tw.base_widget.text for tw in self._tclist]
        self.runtest(testlist, environmentname, reportname, options)
        self._w.set_focus("body") 
开发者ID:kdart,项目名称:pycopia,代码行数:13,代码来源:runner.py

示例7: _edit_cancel

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _edit_cancel(self, form, entry):
        urwid.disconnect_signal(form, 'ok', self._edit_ok, entry)
        urwid.disconnect_signal(form, 'cancel', self._edit_cancel, entry)
        saveentry = self._saveentryval
        del self._saveentryval
        entry._w = saveentry 
开发者ID:kdart,项目名称:pycopia,代码行数:8,代码来源:widgets.py

示例8: _delete

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _delete(self, listentry):
        urwid.disconnect_signal(listentry, 'activate', self._edit_attribute)
        urwid.disconnect_signal(listentry, 'delete', self._delete)
        text, attr = listentry._w.base_widget[0].get_text()
        dlg = DeleteDialog(text)
        urwid.connect_signal(dlg, 'ok', self._delete_ok, listentry)
        urwid.connect_signal(dlg, 'cancel', self._delete_cancel, listentry)
        self._oldw = listentry._w
        listentry._w = dlg 
开发者ID:kdart,项目名称:pycopia,代码行数:11,代码来源:widgets.py

示例9: _delete_cancel

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _delete_cancel(self, dlg, listentry):
        urwid.disconnect_signal(dlg, 'ok', self._delete_ok, listentry)
        urwid.disconnect_signal(dlg, 'cancel', self._delete_cancel, listentry)
        listentry._w = self._oldw
        del self._oldw
        # restore sig handlers
        urwid.connect_signal(listentry, 'activate', self._edit_attribute)
        urwid.connect_signal(listentry, 'delete', self._delete) 
开发者ID:kdart,项目名称:pycopia,代码行数:10,代码来源:widgets.py

示例10: _add_new_testequipment_cancel

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _add_new_testequipment_cancel(self, frm):
        urwid.disconnect_signal(frm, 'ok', self._add_new_testequipment_ok)
        urwid.disconnect_signal(frm, 'cancel', self._add_new_testequipment_cancel)
        frm._emit("popform")

    # editing 
开发者ID:kdart,项目名称:pycopia,代码行数:8,代码来源:widgets.py

示例11: _edit_testequipment_cancel

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _edit_testequipment_cancel(self, form, entry):
        try:
            self.session.rollback()
        except:
            ex, val, tb = sys.exc_info()
            DEBUG(ex.__name__, val)
            self._emit("message", "{}: {}".format(ex.__name__, val))
        urwid.disconnect_signal(form, 'ok', self._edit_testequipment_ok, entry)
        urwid.disconnect_signal(form, 'cancel', self._edit_testequipment_cancel, entry)
        form._emit("popform") 
开发者ID:kdart,项目名称:pycopia,代码行数:12,代码来源:widgets.py

示例12: _edit_testequipment_ok

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _edit_testequipment_ok(self, form, entry):
        try:
            self.session.commit()
        except:
            self.session.rollback()
            ex, val, tb = sys.exc_info()
            DEBUG(ex.__name__, val)
            self._emit("message", "{}: {}".format(ex.__name__, val))
        entry._w.base_widget.set_text(self._stringify_te(entry.testequipment))
        urwid.disconnect_signal(form, 'ok', self._edit_testequipment_ok, entry)
        urwid.disconnect_signal(form, 'cancel', self._edit_testequipment_cancel, entry)
        form._emit("popform")

    # deleting 
开发者ID:kdart,项目名称:pycopia,代码行数:16,代码来源:widgets.py

示例13: _delete_interface

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _delete_interface(self, listentry):
        urwid.disconnect_signal(listentry, 'activate', self._edit_interface)
        urwid.disconnect_signal(listentry, 'delete', self._delete_interface)
        text, attr = listentry._w.base_widget.get_text()
        dlg = DeleteDialog(text)
        urwid.connect_signal(dlg, 'ok', self._delete_ok, listentry)
        urwid.connect_signal(dlg, 'cancel', self._delete_cancel, listentry)
        self._oldw = listentry._w
        listentry._w = dlg 
开发者ID:kdart,项目名称:pycopia,代码行数:11,代码来源:widgets.py

示例14: _edit_complete

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _edit_complete(self, form, pkval, listentry):
        urwid.disconnect_signal(form, 'popform', self._edit_complete, listentry)
        urwid.disconnect_signal(form, 'message', self._message)
        listentry._w.base_widget.set_text(unicode(listentry.interface).encode("utf-8"))
        #self._invalidate()
        form._emit("popform") 
开发者ID:kdart,项目名称:pycopia,代码行数:8,代码来源:widgets.py

示例15: _popform

# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import disconnect_signal [as 别名]
def _popform(self, form, *extra):
        urwid.disconnect_signal(form, 'popform', self._popform)
        urwid.disconnect_signal(form, 'message', self._message)
        ovl = self._w
        self._w = ovl.bottom_w 
开发者ID:kdart,项目名称:pycopia,代码行数:7,代码来源:widgets.py


注:本文中的urwid.disconnect_signal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。