本文整理汇总了Python中urwid.emit_signal函数的典型用法代码示例。如果您正苦于以下问题:Python emit_signal函数的具体用法?Python emit_signal怎么用?Python emit_signal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了emit_signal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: set_connected
def set_connected(self, switch):
self._connected = switch
for child in self.children:
child.set_connected(switch)
urwid.emit_signal(self, "connected", switch)
开发者ID:sushi-irc,项目名称:nigiri,代码行数:7,代码来源:tabs.py
示例2: keypress
def keypress(self, size, key):
if key == "enter":
text = self.get_edit_text()
urwid.emit_signal(self, "send_signal", text)
self.set_edit_text("")
else:
return super(EditSms, self).keypress(size, key)
开发者ID:elKokito,项目名称:sms-term,代码行数:7,代码来源:retut.py
示例3: edit_changed
def edit_changed(self, x, d, *arg):
# r = self.lck.acquire(False)
# if r:
if self.textField._checamudou():
urwid.emit_signal(self, 'change', self, d)
nisk.util.dump((self.textField.value(), self.textField._lastlastvalue, self.textField._checamudou()),
'change date')
开发者ID:thubaichaves,项目名称:pygestor,代码行数:7,代码来源:widgets.py
示例4: keypress
def keypress(self, size, key):
if key=='enter':
line=self.edit_text.strip()
if line:
urwid.emit_signal(self,'line_entered', line)
self.history.append(line)
self._history_index=len(self.history)
self.edit_text=u''
if key=='up':
self._history_index-=1
if self._history_index< 0:
self._history_index= 0
else:
self.edit_text=self.history[self._history_index]
self.set_edit_pos(len(self.edit_text))
if key=='down':
self._history_index+=1
if self._history_index>=len(self.history):
self._history_index=len(self.history)
self.edit_text=u''
else:
self.edit_text=self.history[self._history_index]
self.set_edit_pos(len(self.edit_text))
else:
urwid.Edit.keypress(self, size, key)
开发者ID:vanous,项目名称:random_scripts,代码行数:26,代码来源:commander.py
示例5: __accept
def __accept(self):
new_vals = {
'server_uri': self.server_uri,
'username': self.username,
'password': self.password,
}
urwid.emit_signal(self, SettingsWidget.SIG_SETTINGS_ACCEPTED, new_vals)
开发者ID:posita,项目名称:balanced-hangman,代码行数:7,代码来源:screen.py
示例6: keypress
def keypress(self, size, key):
if key == 'enter':
urwid.emit_signal(self, 'done', self.get_edit_text())
return
if key == 'esc':
urwid.emit_signal(self, 'done', None)
urwid.Edit.keypress(self, size, key)
开发者ID:muromec,项目名称:tyrs,代码行数:7,代码来源:editor.py
示例7: bottom
def bottom(self):
for index in xrange(len(self.contents) - 1, -1, -1):
widget = self.contents[index][0]
if self.constraint(index, widget):
self.focus_position = index
urwid.emit_signal(self, 'shift')
return
开发者ID:Jdaco,项目名称:urwidgets,代码行数:7,代码来源:urwidgets.py
示例8: shiftUp
def shiftUp(self, amount=1):
if self.body.focus is not self.scroll(-amount):
self.focus_position = self.scroll()
self.body[:] = self.body[:]
urwid.emit_signal(self, 'shift')
else:
urwid.emit_signal(self,'top')
开发者ID:Jdaco,项目名称:urwidgets,代码行数:7,代码来源:urwidgets.py
示例9: keypress
def keypress(self, size, key):
if key == "enter":
if self.edit_text == "" and self.history:
self.command = Command(self.history[-1])
else:
self.command = Command(self.edit_text)
self.history.append(self.edit_text)
self.command.executeCommand()
self.historyIdx = -1
self.edit_text = ""
urwid.emit_signal(self, "executed")
elif key == "up":
if len(self.history) != 0:
self.edit_text = self.history[self.historyIdx]
self.edit_pos = len(self.edit_text)
if self.historyIdx - 1 >= -1 * len(self.history):
self.historyIdx -= 1
elif key == "down":
if self.historyIdx == -1:
self.edit_text = ""
else:
self.historyIdx += 1
self.edit_text = self.history[self.historyIdx]
self.edit_pos = len(self.edit_text)
else:
return super(CliEdit, self).keypress(size, key)
开发者ID:hberntsen,项目名称:usim,代码行数:28,代码来源:debug.py
示例10: __cebPrisoners
def __cebPrisoners(self, a_arg_or_err, a_auth, a_prisoners):
if isinstance(a_arg_or_err, twisted.python.failure.Failure):
urwid.emit_signal(self, SIG_RSP_PRISONERS, None, None, a_arg_or_err.value)
return
next_uri = None
iresponse, resp_str, json_obj = a_arg_or_err
new_items = dict(( ( i['id'], i ) for i in json_obj['items'] ))
a_prisoners['items'].update(new_items)
# Note, we check to see if "offset" has changed because there is a
# bug in the server reference implementation where the "offset"
# parameter is ignored (see "Server Issues" section in README)
if json_obj['next'] is not None \
and json_obj.get('offset', SENTINEL) != a_prisoners['offset']:
next_uri = urlparse.urljoin(self.__base_uri, json_obj['next'])
a_prisoners.update(( ( k, v ) for k, v in json_obj.items() if k != 'items' ))
# Keep calling ourselves as long as we have somewhere to go
if next_uri is not None:
d = self._jsonRequest(next_uri, a_auth)
d.addCallback(self.__cebPrisoners, a_auth, a_prisoners)
d.addErrback(self.__cebPrisoners, a_auth, a_prisoners)
return d
urwid.emit_signal(self, SIG_RSP_PRISONERS, a_auth, a_prisoners['items'])
开发者ID:posita,项目名称:balanced-hangman,代码行数:29,代码来源:client.py
示例11: __cebNewAccountLogIn
def __cebNewAccountLogIn(self, a_arg_or_err, a_base_uri, a_auth):
try:
self.__logIn(a_base_uri, a_auth, a_arg_or_err)
except Exception, e:
urwid.emit_signal(self, SIG_RSP_NEW_ACCT, None, e)
return
开发者ID:posita,项目名称:balanced-hangman,代码行数:7,代码来源:client.py
示例12: remove
def remove(self):
""" emit remove signals """
for child in self.children:
child.remove()
self.child_removed(child)
urwid.emit_signal(self, "remove")
self.set_parent(None)
开发者ID:sushi-irc,项目名称:nigiri,代码行数:7,代码来源:tabs.py
示例13: keypress
def keypress(self, size, key):
key = super().keypress(size, key)
if key is not 'enter':
return key
else:
message_text = self.input_field.get_edit_text()
urwid.emit_signal(self, 'message-send', message_text)
开发者ID:aetherith,项目名称:groupcurses,代码行数:7,代码来源:input_area.py
示例14: cmd_exit_msgbox
def cmd_exit_msgbox(self, *args):
if self.logo_displayed:
self.clear_msgbox()
self.logo_displayed = False
self._selectable = False
urwid.emit_signal(self, 'exit_msgbox')
开发者ID:gsec,项目名称:eZchat,代码行数:7,代码来源:ez_cli.py
示例15: keypress
def keypress(self, size, key):
if key == "enter":
self.save()
elif key == "ctrl k":
urwid.emit_signal(self, 'saved')
else:
return super(Saver, self).keypress(size, key)
开发者ID:kylerbrown,项目名称:panoptisong,代码行数:7,代码来源:gui.py
示例16: shiftDown
def shiftDown(self, amount=1):
if self.body.focus is not self.scroll(amount):
self.focus_position = self.scroll()
self.body[:] = self.body[:]
urwid.emit_signal(self, 'shift')
else:
urwid.emit_signal(self, 'bottom')
开发者ID:Jdaco,项目名称:urwidgets,代码行数:7,代码来源:urwidgets.py
示例17: keypress
def keypress(self, size, key):
if self.single:
urwid.emit_signal(self, 'prompt_enter', self, key)
elif key == 'enter':
urwid.emit_signal(self, 'prompt_enter', self, self.get_edit_text())
else:
return urwid.Edit.keypress(self, size, key)
开发者ID:daronwolff,项目名称:CHART_IN_REAL_TIME_socketio_python,代码行数:7,代码来源:urwid.py
示例18: keypress
def keypress(self, size, key):
"""
Handle user inputs
"""
urwid.emit_signal(self, "keypress", size, key)
# scroll the top panel
if key in ("page up","page down","up","down"):
self.body.keypress (size, key)
# resize the main windows
elif key == "window resize":
self.size = self.ui.get_cols_rows()
#
# elif key in ('ctrl q'):
# self.quit()
# self.context.keypress (size, key)
elif key == "enter":
# Parse data or (if parse failed)
# send it to the current world
text = self.footer.get_edit_text()
self.footer.set_edit_text(u" "*len(text))
self.footer.set_edit_text(u"")
if text.strip():
self.print_sent_message(text)
#self.print_received_message('Answer')
else:
self.context.keypress(size, key)
开发者ID:llicour,项目名称:BlackHole,代码行数:31,代码来源:chatGUI.py
示例19: keypress
def keypress(self, size, key):
if key == 'enter':
urwid.emit_signal(self, 'ask_done', self.get_edit_text())
elif key == 'esc':
urwid.emit_signal(self, 'ask_done', None)
elif len(key) != 1 or self.validator is None or self.validator(key):
super().keypress(size, key)
开发者ID:fmichea,项目名称:srddl,代码行数:7,代码来源:fe_curses.py
示例20: do_select
def do_select(self, remember):
accountitem = self.listwalker.get_focus()[0]
if remember:
self.manager.set_default(accountitem.num)
else:
self.manager.set_default(None)
self.close()
urwid.emit_signal(self, 'done', accountitem.account)
开发者ID:anjandev,项目名称:trackma,代码行数:8,代码来源:curses.py
注:本文中的urwid.emit_signal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论