本文整理匯總了Python中repository.Repository.id方法的典型用法代碼示例。如果您正苦於以下問題:Python Repository.id方法的具體用法?Python Repository.id怎麽用?Python Repository.id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類repository.Repository
的用法示例。
在下文中一共展示了Repository.id方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: transplant
# 需要導入模塊: from repository import Repository [as 別名]
# 或者: from repository.Repository import id [as 別名]
def transplant(self, src_dir, dst_dir, items):
src_repo = Repository(src_dir)
dst_repo = Repository(dst_dir)
try:
for item in items:
self._transplant_item(src_repo, dst_repo, item)
tip = dst_repo.id(id=True)
logger.info('tip: %s', tip)
return {'tip': tip}
finally:
self._cleanup(dst_repo)
示例2: getAllRepos
# 需要導入模塊: from repository import Repository [as 別名]
# 或者: from repository.Repository import id [as 別名]
def getAllRepos():
session = getSession()
p = {'since': 17262486}
result = requests.get('https://api.github.com/repositories', params=p, auth=myauth).json()
l = len(result)
counter = 1
print counter, l, p['since']
counter = Counter(5000)
while l > 0:
counter.check_limit()
for proj in result:
if 'id' in proj:
rep = Repository()
rep.id = proj['id']
rep.full_name = proj['full_name']
rep.languages_url = proj['languages_url']
session.add(rep)
else:
print proj
p['since'] = result[-1]['id']
while l == 0:
result = requests.get('https://api.github.com/repositories', params=p, auth=myauth)
l = len(result.json())
counter.increment()
print counter.count, l, p['since']
if l == 0:
print result
result = result.json()
session.commit()