jeffkowalski / geeknote

Console client for Evernote.
GNU General Public License v3.0
392 stars 51 forks source link

`geeknote show something`: handle Ctrl+C on notes menu (exception now) #125

Open vitaly-zdanevich opened 5 years ago

vitaly-zdanevich commented 5 years ago

Notes menu I mean:

Found 6 items                          
  1 : 2019-09-11 2019-09-11 Name of my note
  2 : 2019-08-18 2019-08-20 Name of my another note
  3 : 2019-08-18 2019-08-18 Yet another note
  4 : 2013-02-12 2017-10-30 Important note
  5 : 2015-05-03 2017-05-10 No so important note
  6 : 2016-04-04 2016-06-13 again and again
  0: -Cancel-

After Ctrl-C that is normal case - just I found that I have no note like that, now I get:

: ^CTraceback (most recent call last):
  File "/usr/local/bin/g", line 1734, in main
    Notes().edit(**ARGS)
  File "/usr/local/bin/g", line 1165, in edit
    note = self._searchNote(note)
  File "/usr/local/bin/g", line 1400, in _searchNote
    note = self.getEvernote().getNote(note.guid)
AttributeError: 'NoneType' object has no attribute 'guid'

Better behaviour: print Exit on Ctrl-C.