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


Python GitHub.labels方法代码示例

本文整理汇总了Python中github.GitHub.labels方法的典型用法代码示例。如果您正苦于以下问题:Python GitHub.labels方法的具体用法?Python GitHub.labels怎么用?Python GitHub.labels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.GitHub的用法示例。


在下文中一共展示了GitHub.labels方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GitHub

# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import labels [as 别名]
github = GitHub(github_username, github_password, github_repo)

# Show the Trac usernames assigned to tickets as an FYI

logging.info("Getting Trac ticket owners (will NOT be mapped to GitHub username)...")
for (username,) in trac.sql('SELECT DISTINCT owner FROM ticket'):
    if username:
        username = username.strip() # username returned is tuple like: ('phred',)
        logging.debug("Trac ticket owner: %s" % username)


# Get GitHub labels; we'll merge Trac components and other values into them

logging.info("Getting existing GitHub labels...")
labels = {}
for label in github.labels():
    labels[label['name']] = label['url'] # ignoring 'color'
    logging.debug("label name=%s" % label['name'])

# Get any existing GitHub milestones so we can merge Trac into them.
# We need to reference them by numeric ID in tickets.
# API returns only 'open' issues by default, have to ask for closed like:
# curl -u 'USER:PASS' https://api.github.com/repos/USERNAME/REPONAME/milestones?state=closed

logging.info("Getting existing GitHub milestones...")
milestone_id = {}
for m in github.milestones():
    milestone_id[m['title']] = m['number']
    logging.debug("milestone (open)   title=%s" % m['title'])
for m in github.milestones(query='state=closed'):
    milestone_id[m['title']] = m['number']
开发者ID:callumski,项目名称:github-migrate-trac-tickets,代码行数:33,代码来源:trac-tickets-to-gh.py

示例2: Trac

# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import labels [as 别名]
trac = Trac(trac_db_path)
github = GitHub(github_username, github_password, github_repo)

# Show the Trac usernames assigned to tickets as an FYI

logging.info("Getting Trac ticket owners (will NOT be mapped to GitHub username)...")
for (username,) in trac.sql('SELECT DISTINCT owner FROM ticket WHERE component="%s"' % trac_component):
    if username:
        username = username.strip()  # username returned is tuple like: ('phred',)
        logging.debug("Trac ticket owner: %s" % username)

# Get GitHub labels; we'll merge Trac priorities and types into them

logging.info("Getting existing GitHub labels...")
gh_labels = {}
for label in github.labels():
    gh_labels[label["name"]] = True
    logging.debug("label name=%s" % label["name"])

if options.milestones:
    # Get any existing GitHub milestones so we can merge Trac into them.
    # We need to reference them by numeric ID in tickets.
    # API returns only 'open' issues by default, have to ask for closed like:
    # curl -u 'USER:PASS' https://api.github.com/repos/USERNAME/REPONAME/milestones?state=closed

    logging.info("Getting existing GitHub milestones...")
    milestone_id = {}
    for m in github.milestones():
        milestone_id[m["title"]] = m["number"]
        logging.debug("milestone (open)   title=%s" % m["title"])
    for m in github.milestones(query="state=closed"):
开发者ID:tfoote,项目名称:github-migrate-trac-tickets,代码行数:33,代码来源:migrate.py

示例3: GitHub

# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import labels [as 别名]
github = GitHub(github_username, github_password, github_repo)

# Show the Trac usernames assigned to tickets as an FYI

logging.info("Getting Trac ticket owners (will NOT be mapped to GitHub username)...")
for (username,) in trac.sql('SELECT DISTINCT owner FROM ticket'):
    if username:
        username = username.strip() # username returned is tuple like: ('phred',)
        logging.debug("Trac ticket owner: %s" % username)


# Get GitHub labels; we'll merge Trac components into them

logging.info("Getting existing GitHub labels...")
labels = {}
for label in github.labels():
    labels[label['name']] = label['url'] # ignoring 'color'
    logging.debug("label name=%s" % label['name'])

# Get any existing GitHub milestones so we can merge Trac into them.
# We need to reference them by numeric ID in tickets.
# API returns only 'open' issues by default, have to ask for closed like:
# curl -u 'USER:PASS' https://api.github.com/repos/USERNAME/REPONAME/milestones?state=closed

logging.info("Getting existing GitHub milestones...")
milestone_id = {}
for m in github.milestones():
    milestone_id[m['title']] = m['number']
    logging.debug("milestone (open)   title=%s" % m['title'])
for m in github.milestones(query='state=closed'):
    milestone_id[m['title']] = m['number']
开发者ID:STEllAR-GROUP,项目名称:github-migrate-trac-tickets,代码行数:33,代码来源:trac-tickets-to-gh.py

示例4: Trac

# 需要导入模块: from github import GitHub [as 别名]
# 或者: from github.GitHub import labels [as 别名]
trac = Trac(trac_db_path)
github = GitHub(github_username, github_password, github_repo)

# Show the Trac usernames assigned to tickets as an FYI

logging.info("Getting Trac ticket owners (will NOT be mapped to GitHub username)...")
for (username,) in trac.sql('SELECT DISTINCT owner FROM ticket WHERE component="%s"' % trac_component):
    if username:
        username = username.strip() # username returned is tuple like: ('phred',)
        logging.debug("Trac ticket owner: %s" % username)

# Get GitHub labels; we'll merge Trac priorities and types into them

logging.info("Getting existing GitHub labels...")
gh_labels = {}
for label in github.labels():
    gh_labels[label['name']] = True
    logging.debug("label name=%s" % label['name'])

if options.milestones:
    # Get any existing GitHub milestones so we can merge Trac into them.
    # We need to reference them by numeric ID in tickets.
    # API returns only 'open' issues by default, have to ask for closed like:
    # curl -u 'USER:PASS' https://api.github.com/repos/USERNAME/REPONAME/milestones?state=closed

    logging.info("Getting existing GitHub milestones...")
    milestone_id = {}
    for m in github.milestones():
        milestone_id[m['title']] = m['number']
        logging.debug("milestone (open)   title=%s" % m['title'])
    for m in github.milestones(query='state=closed'):
开发者ID:hershwg,项目名称:github-migrate-trac-tickets,代码行数:33,代码来源:migrate.py


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