Beispiel #1
0
from helper_routines import modification_date
from helper_routines import access_date
from helper_routines import checkPath
from helper_routines import getNotesFileNames
from helper_routines import stripEmptyTailLines
from helper_routines import wrapNoteInTagLineAndFooter

import sys
import os
import codecs
from datetime import datetime
import math

import argparse
import time

parser = argparse.ArgumentParser(description="My parser")
parser.add_argument('path')
parser.add_argument('-f', '--fix-note', action='store_true')
args = parser.parse_args()

notesPath = os.path.join(args.path, '')  # add trailing slash if it's not there
checkPath(notesPath)

notesFileNames = getNotesFileNames(notesPath)

for noteFileName in notesFileNames:
    noteFilePath = notesPath + noteFileName

    wrapNoteInTagLineAndFooter(args.fix_note, noteFilePath)
import codecs
from datetime import datetime
import math

import argparse
import time

parser = argparse.ArgumentParser(description="My parser")
parser.add_argument('path')
parser.add_argument('-f', '--fix-notes', action='store_true')
parser.add_argument('-n', '--new-path')
parser.add_argument('-v', '--verbose')
args = parser.parse_args()

notesOldPath = os.path.join(args.path,
                            '')  # add trailing slash if it's not there
checkPath(notesOldPath)

notesNewPath = os.path.join(args.new_path,
                            '')  # add trailing slash if it's not there
checkPath(notesNewPath)

notesFileNames = getNotesFileNames(notesOldPath)

for noteFileName in notesFileNames:
    noteFilePath = notesOldPath + noteFileName

    changeNoteNameAssetDirNameAndAssetsLinks(args.fix_notes, args.verbose,
                                             notesOldPath, noteFileName[:-3],
                                             noteFileName[:-3], notesNewPath)
# coding=utf-8

from helper_routines import creation_date
from helper_routines import modification_date
from helper_routines import access_date
from helper_routines import checkPath
from helper_routines import getNotesFileNames
from helper_routines import stripEmptyTailLines
from helper_routines import wrapNoteInTagLineAndFooter

import sys
import os
import codecs
from datetime import datetime
import math


import argparse
import time


parser = argparse.ArgumentParser(description="My parser")
parser.add_argument('path')
args = parser.parse_args()

noteFilePath = args.path
checkPath(noteFilePath)


wrapNoteInTagLineAndFooter(True, noteFilePath)
from subprocess import call
import re
import string

import argparse
import os

parser = argparse.ArgumentParser(description="My parser")
parser.add_argument('path')
parser.add_argument('-f', '--fix-assets-references', action='store_true')
args = parser.parse_args()

notesPath = os.path.join(args.path, '')  # add trailing slash if it's not there
assetsPath = notesPath + "assets/"

checkPath(notesPath)
checkPath(assetsPath)

NOTES_ABSOLUTE_PATH = "file://" + os.path.abspath(notesPath) + "/"
ASSETS_ABSOLUTE_PATH = NOTES_ABSOLUTE_PATH + "assets/"

notesFileNames = getNotesFileNames(notesPath)
attachmentsDirectoryNames = getAttachmentsDirectoryNames(assetsPath)

print(notesPath)
print(args.fix_assets_references)
#quit()
"""
for eachDirectory in attachmentsDirectoryNames:
    originalDirectoryPath = notesPath + eachDirectory