Added events for tag updates

main
Amlesh Sivanantham (zamlz) 6 years ago
parent 6b74683fb4
commit 663e5ab1d0
No known key found for this signature in database
GPG Key ID: 882C395C3B28902C

@ -26,6 +26,7 @@ from .. import pretty
from .. import color
from ..utils import resolve_citekey
from ..completion import CiteKeyOrTagCompletion, TagModifierCompletion
from ..events import TagEvent
def parser(subparsers, conf):
@ -101,7 +102,8 @@ def command(conf, args):
p.add_tag(tag)
for tag in remove_tags:
p.remove_tag(tag)
rp.push_paper(p, overwrite=True)
rp.push_paper(p, overwrite=True, event=False)
TagEvent(citekeyOrTag).send()
elif tags is not None:
ui.error(ui.error('No entry found for citekey {}.'.format(citekeyOrTag)))
ui.exit()

@ -51,6 +51,10 @@ class RemoveEvent(PaperEvent):
class DocRemoveEvent(PaperEvent):
_format = "Removes document for {citekey}."
# Used by commands.tag_cmd.command()
class TagEvent(PaperEvent):
_format = "Updates tags for {citekey}."
# Used by commands.edit_cmd.command()
class ModifyEvent(PaperEvent):
_format = "Modifies {file_type} file of {citekey}."
@ -78,4 +82,4 @@ class RenameEvent(PaperEvent):
# Used by commands.note_cmd.command()
class NoteEvent(PaperEvent):
_format = "Modifies note {citekey}"
_format = "Modifies note {citekey}."

Loading…
Cancel
Save