Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser.NoSectionError: No section: 'evernote' #3

Open
chouti opened this issue Jul 12, 2023 · 4 comments
Open

ConfigParser.NoSectionError: No section: 'evernote' #3

chouti opened this issue Jul 12, 2023 · 4 comments

Comments

@chouti
Copy link

chouti commented Jul 12, 2023

Traceback (most recent call last):
  File "/Users/daniel/miniconda3/envs/synctogit/bin/synctogit", line 8, in <module>
    sys.exit(main())
  File "/Users/daniel/miniconda3/envs/synctogit/lib/python2.7/site-packages/synctogit/main.py", line 35, in main
    run(pargs)
  File "/Users/daniel/miniconda3/envs/synctogit/lib/python2.7/site-packages/synctogit/main.py", line 49, in run
    while _sync(git, evernote, config, pargs):
  File "/Users/daniel/miniconda3/envs/synctogit/lib/python2.7/site-packages/synctogit/main.py", line 67, in _sync
    config.set('evernote', 'token', base64.b64encode(token))
  File "/Users/daniel/miniconda3/envs/synctogit/lib/python2.7/site-packages/synctogit/Config.py", line 60, in set
    self.conf.set(section, key, value)
  File "/Users/daniel/miniconda3/envs/synctogit/lib/python2.7/ConfigParser.py", line 396, in set
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'evernote'
@lhl
Copy link

lhl commented Jul 18, 2023

Was just trying to get this working and grepping through the source, it looks like you can add this to your config:

[evernote]
sandbox = false

@KostyaEsmukov
Copy link
Owner

The version uploaded to pypi is very old, I'm not even sure it would work. You may try installing from github:

# Requires python 3.7 or newer
pip3 install https://github.com/KostyaEsmukov/SyncToGit/archive/refs/heads/next.tar.gz

Sample config:

[general]
timezone = Europe/London

[git]
repo_dir = my-git-repo-path
push = false

[evernote]
sandbox = false

@lhl
Copy link

lhl commented Jul 18, 2023

Yeah, I actually had to install Python 2.7 to try to get the pypi version working. It had problems initializing the git repo, and while poking around I noticed it was like 6 years old and saw that the git repo was significantly updated and just switched to using a HEAD checkout. This is what I did to get that working:

pip install git+https://github.com/KostyaEsmukov/SyncToGit
pip install 'synctogit[evernote]
git init
git add README.md
git commit README.md -m 'first commit'
synctogit ~/.synctogit/config.ini evernote

I had to manually setup the git folder since the auto-initilization in an empty folder seemed to fail. One other thing I did was to go into the filename_sanitizer.py and modify L48 and set it to truncate filename = filename[:_max_filename_len] instead of erroring (I had a lot of notes w/ the webclipper that apparently had very long titles) - this probably isn't the best behavior, and I have to check if some data if note titles aren't also exported into the HTML, but I've already done manual ENEX exports and also used evernote-backup so figure I'm mostly covered either way.

Thanks for maintaining this tool btw, nice to have export options (I haven't really used my Evernote for years, but also was lazy about doing full exports, but with the recent hubbub, better to have a proper backups now!)

@KostyaEsmukov
Copy link
Owner

Yeah, I sort of neglected the proper community-side maintenance of this project and haven't been making pypi releases or updating the docs. However, I'm still using it, so it's in a working shape, albeit not very beginner-friendly.

The steps you wrote are absolutely correct, thanks for the addition! It's been a long time since I set this up, and now it just simply works, keeping my notes backed up. Although I no longer use evernote, I've switched to onenote for my daily use, which backups are also implemented in this tool. However, evernote support in this project is still present, and I think it should work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants