本文整理汇总了Python中webkitpy.common.system.user.User.prompt_with_list方法的典型用法代码示例。如果您正苦于以下问题:Python User.prompt_with_list方法的具体用法?Python User.prompt_with_list怎么用?Python User.prompt_with_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webkitpy.common.system.user.User
的用法示例。
在下文中一共展示了User.prompt_with_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _builder_to_analyze
# 需要导入模块: from webkitpy.common.system.user import User [as 别名]
# 或者: from webkitpy.common.system.user.User import prompt_with_list [as 别名]
def _builder_to_analyze(self):
statuses = self._tool.buildbot.builder_statuses()
choices = [status["name"] for status in statuses]
chosen_name = User.prompt_with_list("Which builder to analyze:", choices)
for status in statuses:
if status["name"] == chosen_name:
return (self._tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
示例2: create_bug
# 需要导入模块: from webkitpy.common.system.user import User [as 别名]
# 或者: from webkitpy.common.system.user.User import prompt_with_list [as 别名]
def create_bug(
self,
bug_title,
bug_description,
component=None,
diff=None,
patch_description=None,
cc=None,
blocked=None,
assignee=None,
mark_for_review=False,
mark_for_commit_queue=False,
):
self.authenticate()
_log.info('Creating bug with title "%s"' % bug_title)
self.browser.open(config_urls.bug_server_url + "enter_bug.cgi?product=WebKit")
self.browser.select_form(name="Create")
component_items = self.browser.find_control("component").items
component_names = map(lambda item: item.name, component_items)
if not component:
component = "New Bugs"
if component not in component_names:
component = User.prompt_with_list("Please pick a component:", component_names)
self.browser["component"] = [component]
if cc:
self.browser["cc"] = cc
if blocked:
self.browser["blocked"] = unicode(blocked)
if not assignee:
assignee = self.username
if assignee and not self.browser.find_control("assigned_to").disabled:
self.browser["assigned_to"] = assignee
self.browser["short_desc"] = bug_title
self.browser["comment"] = bug_description
if diff:
# _fill_attachment_form expects a file-like object
# Patch files are already binary, so no encoding needed.
assert isinstance(diff, str)
patch_file_object = StringIO.StringIO(diff)
commit_flag = CommitQueueFlag.mark_for_nothing
if mark_for_commit_queue:
commit_flag = CommitQueueFlag.mark_for_commit_queue
self._fill_attachment_form(
patch_description,
patch_file_object,
mark_for_review=mark_for_review,
commit_flag=commit_flag,
is_patch=True,
)
response = self.browser.submit()
bug_id = self._check_create_bug_response(response.read())
_log.info("Bug %s created." % bug_id)
_log.info("%sshow_bug.cgi?id=%s" % (config_urls.bug_server_url, bug_id))
return bug_id
示例3: _builder_to_explain
# 需要导入模块: from webkitpy.common.system.user import User [as 别名]
# 或者: from webkitpy.common.system.user.User import prompt_with_list [as 别名]
def _builder_to_explain(self):
builder_statuses = self.tool.buildbot.builder_statuses()
red_statuses = [status for status in builder_statuses if not status["is_green"]]
print "%s failing" % (pluralize("builder", len(red_statuses)))
builder_choices = [status["name"] for status in red_statuses]
# We could offer an "All" choice here.
chosen_name = User.prompt_with_list("Which builder to diagnose:", builder_choices)
# FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
for status in red_statuses:
if status["name"] == chosen_name:
return (self.tool.buildbot.builder_with_name(chosen_name), status["built_revision"])