Beispiel #1
0
def getAllFiles():
    root = data.notesRoot()
    files = walkGatherALlFiles(root)
    files = [f for f in files if os.path.splitext(os.path.split(f)[1])[1] == '.md']
    return files
Beispiel #2
0
    notes = splitFlatFileInNoteChunck(contentLines)

    processedLoc = folderOut
    for note in notes:
        objNote = Note.fromText(note)

        if 'merge' in objNote.tags():
            # Do not handle this scenario yet...
            pass

        objNote.writeSelf(processedLoc)

    return processedLoc

def getArgs():
    parser = argparse.ArgumentParser()
    parser.add_argument('file', default = 'ingest.md')
    return parser.parse_args()

if __name__ == '__main__':
    args = getArgs()

    folderOut = data.notesRoot()
    filename = args.file
    contentLines = open(filename).readlines()

    backupFileToBeIngested(filename, os.path.join(folderOut, 'backups'), contentLines)
    ingest(os.path.join(folderOut, 'notes/low'), contentLines)
    os.remove(filename)

Beispiel #3
0
def resolveDataLocation(dataLocation = None):
    if dataLocation == None:
        dataLocation = data.notesRoot()

    file = data.ingestFilename(dataLocation)
    return dataLocation, file