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


Python Feedback.output方法代码示例

本文整理汇总了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)
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:7,代码来源:core.py

示例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()
开发者ID:ArrayDsj,项目名称:alfred-dict-workflow,代码行数:32,代码来源:query.py

示例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)
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:8,代码来源:core.py


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