本文整理汇总了Python中Helper.owner_and_repo方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.owner_and_repo方法的具体用法?Python Helper.owner_and_repo怎么用?Python Helper.owner_and_repo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper.owner_and_repo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_issue
# 需要导入模块: import Helper [as 别名]
# 或者: from Helper import owner_and_repo [as 别名]
def create_issue(task):
api = GithubAPIGateway(token=os.environ["GITHUB_TOKEN"])
username = api.call("user")[0]["login"]
body = "### {0}\n___\n\n{1}".format(task["permalink"].encode("utf-8"), task["description"].encode("utf-8"))
owner, repo = Helper.owner_and_repo()
issue = api.call(
"create_issue", owner=owner, repo=repo, data={"title": task["title"], "assignee": username, "body": body}
)[0]
return issue
示例2: _create_auth_info
# 需要导入模块: import Helper [as 别名]
# 或者: from Helper import owner_and_repo [as 别名]
def _create_auth_info(self):
webbrowser.open('https://www.wrike.com/oauth2/authorize?client_id={0}&response_type=code'.format(os.environ['WRIKE_CLIENT_ID']))
self._httpd = QuickSocketServer()
self._serverthread = ServerThread(self._httpd)
self._serverthread.start()
while self._httpd.authentication_code is None: pass
authentication_code = self._httpd.authentication_code
if self._redirect is not None:
self.redirect(self._redirect)
owner, repo = Helper.owner_and_repo()
auth_info = super(WrikeAPIGateway, self).call('get_token', params={
'client_id': os.environ['WRIKE_CLIENT_ID'],
'client_secret': os.environ['WRIKE_CLIENT_SECRET'],
'code': authentication_code
})[0]
with open(self._get_auth_file_filepath(), 'w') as outfile:
json.dump(auth_info, outfile)
return auth_info
示例3: GithubAPIGateway
# 需要导入模块: import Helper [as 别名]
# 或者: from Helper import owner_and_repo [as 别名]
from GithubAPIGateway import GithubAPIGateway
import Helper
import os
import sys
import argparse
import webbrowser
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--open", action="store_true")
args = parser.parse_args()
api = GithubAPIGateway(token=os.environ['GITHUB_TOKEN'])
owner, repo = Helper.owner_and_repo()
branch = str(Helper.current_branch())
prs = api.call('list_pr', owner=owner, repo=repo, data={
'head': branch
})[0]
url = None
for pr in prs:
if pr['head']['ref'] == branch:
url = pr['html_url']
break
if url is not None:
print url
if args.open:
webbrowser.open(url)
else:
print "No PRs on this branch"
示例4: __init__
# 需要导入模块: import Helper [as 别名]
# 或者: from Helper import owner_and_repo [as 别名]
def __init__(self):
self._username, self._project = Helper.owner_and_repo()
self._api = CircleCiAPIGateway(token=os.environ['CIRCLE_TOKEN'])
示例5: __init__
# 需要导入模块: import Helper [as 别名]
# 或者: from Helper import owner_and_repo [as 别名]
def __init__(self):
self._owner, self._repo = Helper.owner_and_repo()
self._api = GithubAPIGateway(token=os.environ['GITHUB_TOKEN'])
self._cache = {}