From 4862860a7eeb20868ae81870841701d48612b76b Mon Sep 17 00:00:00 2001 From: "Amlesh Sivanantham (zamlz)" Date: Mon, 11 Mar 2019 11:58:10 -0700 Subject: [PATCH] Added git functionality for notes --- pubs/commands/note_cmd.py | 2 ++ pubs/events.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pubs/commands/note_cmd.py b/pubs/commands/note_cmd.py index 8def803..367e799 100644 --- a/pubs/commands/note_cmd.py +++ b/pubs/commands/note_cmd.py @@ -2,6 +2,7 @@ from .. import repo from ..uis import get_ui from ..utils import resolve_citekey from ..completion import CiteKeyCompletion +from ..events import NoteEvent def parser(subparsers, conf): @@ -19,4 +20,5 @@ def command(conf, args): citekey = resolve_citekey(rp, args.citekey, ui=ui, exit_on_fail=True) notepath = rp.databroker.real_notepath(citekey, rp.conf['main']['note_extension']) ui.edit_file(notepath, temporary=False) + NoteEvent(citekey).send() rp.close() diff --git a/pubs/events.py b/pubs/events.py index e498954..df8fec4 100644 --- a/pubs/events.py +++ b/pubs/events.py @@ -67,3 +67,6 @@ class RenameEvent(PaperEvent): @property def description(self): return self._format.format(citekey=self.citekey, old_citekey=self.old_citekey) + +class NoteEvent(PaperEvent): + _format = "Modifies note {citekey}"