Esempio n. 1
0
        logging.fatal("Could not connect to Evernote")
        sys.exit(1)


    # Get Hello notes from Evernote
    # Check for required parameter, if not present, ask for it
    if not options.hello_notebook:
        options.hello_notebook = raw_input("Your Hello Notebook name: ")
    notebook = ec.get_notebook_by_name(options.hello_notebook)
    if not notebook:
        if options.create_notebook:
            notebook = ec.create_notebook(options.hello_notebook)
        else:
            # try to connect to business account
            logging.debug("Authenticating to business...")
            if ec.connect_to_business():
                notebook = ec.get_notebook_by_name(options.hello_notebook)
                if not notebook:
                    logging.fatal('Notebook "%s" not found (Personal and Business). If you want it to be created, pass --create-notebook in command line.' %  hello_notebook)
                    sys.exit(1)
            else:
                logging.fatal('Notebook "%s" not found. If you want it to be created, pass --create-notebook in command line.' %  hello_notebook)
                sys.exit(1)

    # get all notes metadata from the notebook
    logging.debug("Downloading notes metadata...")
    notes = list(find_all_notes_metadata(ec, NoteFilter(notebookGuid=notebook.guid),
                                         NotesMetadataResultSpec(includeAttributes=True,
                                                                 includeLargestResourceMime=True)))

    # Connect to yammer