示例#1
0
def sync(local_dir, notebook_name):
    if not os.path.exists(local_dir):
        error("{} doesn't exist".format(local_dir))
    with utils.chdir(local_dir):
        client = EvernoteClient(service_host=service_host, token=dev_token)
        store = client.get_note_store()
        notebook = tset_notebook(store, notebook_name)
        files = utils.filter_files('.', supported_file_exts)
        log('Found {} note files under {}'.format(len(files), os.getcwd()))
        result = upsert_notes(store, files, notebook)
    log('''Sync completed.
    Created:{created}
    Updated:{updated}
    Removed:{removed}'''.format(**result))
示例#2
0
文件: main.py 项目: yejianye/eversync
def sync(local_dir, notebook_name):
    if not os.path.exists(local_dir):
        error("{} doesn't exist".format(local_dir))
    with utils.chdir(local_dir):
        client = EvernoteClient(service_host=service_host, token=dev_token)
        store = client.get_note_store()
        notebook = tset_notebook(store, notebook_name)
        files = utils.filter_files('.', supported_file_exts)
        log('Found {} note files under {}'.format(
            len(files), os.getcwd()))
        result = upsert_notes(store, files, notebook)
    log('''Sync completed.
    Created:{created}
    Updated:{updated}
    Removed:{removed}'''.format(**result))
示例#3
0
def evernote_api_error(e, note):
    error(e)
    if e.errorCode == EDAMErrorCode.ENML_VALIDATION:
        error("Invalid note content:")
        error(note.content)
    sys.exit(1)
示例#4
0
文件: main.py 项目: yejianye/eversync
def evernote_api_error(e, note):
    error(e)
    if e.errorCode == EDAMErrorCode.ENML_VALIDATION:
        error("Invalid note content:")
        error(note.content)
    sys.exit(1)