Beispiel #1
0
def scanJson4Flashcards():
    Git2Json()
    with open('GitDump.json') as json_file:
        AllFilesContent = json.load(json_file)

    flashcardsList = []

    for fileContent in AllFilesContent:
        flashcardsList += flashcards.scan4Flashcards(fileContent)

    return (flashcardsList)
Beispiel #2
0
def scanGit4Flashcards(path=""):
    contents = repo.get_contents(path)
    flashcardsList = []
    #print (contents)

    while contents:
        content = contents.pop(0)
        # print(content.url)
        if '/assets/' not in content.url:  #TODO change to assetsfolder
            if content.type == "dir":
                contents.extend(repo.get_contents(content.path))
            else:
                #pass
                #file = content
                flashcardsList += flashcards.scan4Flashcards(
                    getGitFileContent(content))
    return (flashcardsList)