本文整理汇总了Python中feedback.Feedback.output方法的典型用法代码示例。如果您正苦于以下问题:Python Feedback.output方法的具体用法?Python Feedback.output怎么用?Python Feedback.output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feedback.Feedback
的用法示例。
在下文中一共展示了Feedback.output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exitWithFeedback
# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import output [as 别名]
def exitWithFeedback(**kwargs):
fb = Feedback()
fb.addItem(**kwargs)
fb.output()
sys.exit(0)
示例2: query
# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import output [as 别名]
'update': 'Update config'
}
feedback.add_item(title='Internal commands',
subtitle=u'Press "↩" to execute selected internal command',
valid=False)
for cmd, desc in internal_cmds.iteritems():
feedback.add_item(title=cmd, subtitle=desc,
arg=':{}'.format(cmd), valid=True)
else:
arg = u'{} @ {}'.format(word.decode('utf-8'), dictionary.decode('utf-8'))
try:
result = query(dictionary, word)
if result:
action = config['keymap']['none'] if config else 'open'
feedback.add_item(title=result[0],
subtitle=u'Press "↩" to {} or "⌘/⌥/⌃/⇧/fn + ↩" to lookup word in other dicts.'.format(
'view full definition' if action == 'open' else 'pronounce word'),
arg=arg, valid=True)
for item in result[1:]:
feedback.add_item(title=item, arg=u'{} | {}'.format(arg, item), valid=True)
else:
feedback.add_item(title='Dict - Lookup Word',
subtitle=u'Word "{}" doesn\'t exist in dict "{}".'.format(
word.decode('utf-8'), dictionary.decode('utf-8')),
arg=arg, valid=True)
except cndict.DictLookupError, e:
feedback.add_item(title=word, subtitle='Error: {}'.format(e), arg=arg, valid=True)
else:
sys.exit(1)
feedback.output()
示例3: exitWithFeedback
# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import output [as 别名]
def exitWithFeedback(**kwargs):
retcode = kwargs.pop('retcode', 0)
fb = Feedback()
fb.addItem(**kwargs)
fb.output()
sys.exit(retcode)