示例#1
0
文件: git.py 项目: Nek/Lupin
def Git2Json(path=""):
    AllFilesContent = []
    contents = repo.get_contents(path)

    while contents:
        content = contents.pop(0)

        if '/assets/' not in content.url:
            if content.type == "dir":
                contents.extend(repo.get_contents(content.path))
            else:
                AllFilesContent.append(getGitFileContent(content))
    utils.saveasJson(AllFilesContent, "GitDump.json")
示例#2
0
文件: git.py 项目: pomdtr/Lupin
def Git2Json(path=""):
    AllFilesContent = []
    contents = repo.get_contents(path)

    while contents:
        content = contents.pop(0)
        # print("fetching " + content.path)
        if '/assets/' not in content.url:
            if content.type == "dir":
                contents.extend(repo.get_contents(content.path))
            else:
                gitFileContent = getGitFileContent(content)
                if gitFileContent:
                    AllFilesContent.append(gitFileContent)

    utils.saveasJson(AllFilesContent, "/tmp/GitDump.json")