ambv / zzyzx

A simple IMAP Notes backup tool.
6 stars 1 forks source link

Very promising #1

Open chew-z opened 8 years ago

chew-z commented 8 years ago

But it fails on my system with:

File "/Users/rrj/.virtualenvs/zzyzx/lib/python3.5/site-packages/zzyzx/util.py", line 210, in has_hg
    stdout=subprocess.DEVNULL,
...
FileNotFoundError: [Errno 2] No such file or directory: 'hg'
During handling of the above exception, another exception occurred:
...
File "/Users/rrj/.virtualenvs/zzyzx/lib/python3.5/site-packages/zzyzx/backup.py", line 22, in backup
    if hg_path and util.has_hg(hg_path):
File "/Users/rrj/.virtualenvs/zzyzx/lib/python3.5/site-packages/zzyzx/util.py", line 217, in has_hg
    fg='yellow',
TypeError: echo() got an unexpected keyword argument 'fg'

Something configuration specific, I suppose...

ambv commented 8 years ago

This happens if you don't have Mercurial installed on your box. I will make the error message less hostile for this case.

chew-z commented 8 years ago

Yes, I have figured that out. So Mercurial is a requirement? What else? BTW. You are right about cloud. Since Evernote introduced new limits on it's free tier and raised prices on paid tiers I am looking into IMAP Notes as an alternative. Hence mine interest in your tool.

chew-z commented 8 years ago

I have installed hg and zzyzx moves on - connects to IMAP and downloads notes. However now it fails with:

File ".virtualenvs/zzyzx/lib/python3.5/site-packages/zzyzx/backup.py", line 89, in backup_mailbox
    msg['x-mail-created-date'],
  File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/email/utils.py", line 210, in parsedate_to_datetime
    *dtuple, tz = _parsedate_tz(data)
TypeError: 'NoneType' object is not iterable
chew-z commented 8 years ago

Cool, after removing some notes zzyzx backup works. I had notes form various sources and guess not all notes come equal. It would be nice if program fail gracefully though.

However now I can't make zzyzx md work.

$ zzyzx md
Error: No such command "md".
ambv commented 8 years ago

For md support you need to do pip install zzyzx[markdown].

chew-z commented 8 years ago
pip install zzyzx[markdown]                                                           (env: zzyzx)
zsh: no matches found: zzyzx[markdown]

Am I really that dumb?

ambv commented 8 years ago

Haha, no worries, man. This time you've been hit by zshell's bracket expansion. Try:

pip install "zzyzx[markdown]"
chew-z commented 8 years ago

Heureka! It works. All my notes backed up and I can view them in Markdown. This is so cool.

If I may suggest, it would be nice to specify markdown files extension explicit in config. '.md' works best for my setup with quicklook preview, editor, markoff etc. and '.txt' is too generic.

Also is it possible to store password in keychain (on OSX) extracing it like in mutt/offlineimap with perl or python snipet?

set my_pass = "security find-internet-password -g -a user@example.com 2>&1| perl -e 'if ( =~ m/password: "(.*)"$/ ) { print $1; }'"