我想获取存储配置文件的内容。
我使用以下代码:
repos = [f for f in gh.iter_user_repos(git_org, branch)]
modules = {}
modules_infos = {}
for a in repos:
# get the list folder in repo
if not a or not a.contents('.', branch):
continue
# get the list modules in each folder
for cont in a.contents('.', branch).iteritems():
if '.' not in cont[0] and cont[0] not in EXCEPTION_FOLDER:
modules.update({cont[1].name: cont[1].html_url})
if not cont[1] or not a.contents(cont[1].name, branch):
continue
for sub_folder in a.contents(cont[1].name, branch).iteritems():
if sub_folder[0] == 'configurations.txt':
vals = eval(base64.b64decode(sub_folder[1].content))
modules_infos.update({cont[1].name: [vals.get('name', False),
vals.get('version', False),]})
但是,sub_folder[1].content
是空的,我无法获取我的信息。
那么,我错过了什么吗?