Added events for tag updates
This commit is contained in:
parent
6b74683fb4
commit
663e5ab1d0
@ -26,6 +26,7 @@ from .. import pretty
|
|||||||
from .. import color
|
from .. import color
|
||||||
from ..utils import resolve_citekey
|
from ..utils import resolve_citekey
|
||||||
from ..completion import CiteKeyOrTagCompletion, TagModifierCompletion
|
from ..completion import CiteKeyOrTagCompletion, TagModifierCompletion
|
||||||
|
from ..events import TagEvent
|
||||||
|
|
||||||
|
|
||||||
def parser(subparsers, conf):
|
def parser(subparsers, conf):
|
||||||
@ -101,7 +102,8 @@ def command(conf, args):
|
|||||||
p.add_tag(tag)
|
p.add_tag(tag)
|
||||||
for tag in remove_tags:
|
for tag in remove_tags:
|
||||||
p.remove_tag(tag)
|
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:
|
elif tags is not None:
|
||||||
ui.error(ui.error('No entry found for citekey {}.'.format(citekeyOrTag)))
|
ui.error(ui.error('No entry found for citekey {}.'.format(citekeyOrTag)))
|
||||||
ui.exit()
|
ui.exit()
|
||||||
|
@ -51,6 +51,10 @@ class RemoveEvent(PaperEvent):
|
|||||||
class DocRemoveEvent(PaperEvent):
|
class DocRemoveEvent(PaperEvent):
|
||||||
_format = "Removes document for {citekey}."
|
_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()
|
# Used by commands.edit_cmd.command()
|
||||||
class ModifyEvent(PaperEvent):
|
class ModifyEvent(PaperEvent):
|
||||||
_format = "Modifies {file_type} file of {citekey}."
|
_format = "Modifies {file_type} file of {citekey}."
|
||||||
@ -78,4 +82,4 @@ class RenameEvent(PaperEvent):
|
|||||||
|
|
||||||
# Used by commands.note_cmd.command()
|
# Used by commands.note_cmd.command()
|
||||||
class NoteEvent(PaperEvent):
|
class NoteEvent(PaperEvent):
|
||||||
_format = "Modifies note {citekey}"
|
_format = "Modifies note {citekey}."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user