本文整理汇总了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])
示例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
示例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")
示例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)
示例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()
示例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")
示例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
示例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
示例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)
示例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
示例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")
示例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
示例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
示例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")
示例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