Ejemplo n.º 1
0
 def edit_note(self):
     """ Edit the note related with this dataset or create a new one and edit it """
     try:
         note_id = self.note_id
         __notes__.edit_note(note_id)
     except AttributeError:
         self.note_id = __notes__.new_note()
         __notes__.edit_note(self.note_id)
 def edit_note(self):
     """ Edit the note related with this dataset or create a new one and edit it """
     try:
         note_id = self.note_id
         __notes__.edit_note(note_id)
     except AttributeError:
         self.note_id = __notes__.new_note()
         __notes__.edit_note(self.note_id)
    def cmd_notes(self, *args):
        parser = argparse.ArgumentParser(prog="notes", description="Manage notes", epilog="Manage notes")
        parser.add_argument('-l', '--listnotes', action="store_true", help="List all the notes in the system.")
        parser.add_argument('-d', '--deletenote', metavar="note_id", help="Delete a note.")
        parser.add_argument('-f', '--filter', metavar="filter", nargs = '+', help="Use this filter to work with notes. You can use multiple filter separated by a space. Format: \"variable[=<>]value\". You can use the variables: text. For example: -f text=hi text!=p2p.")
        parser.add_argument('-s', '--show', type=int, metavar="note_id", help="Show this note id.")
        parser.add_argument('-e', '--edit', type=int, metavar="note_id", help="Edit this note id.")
        parser.add_argument('-S', '--search', type=str, metavar="text", help="Search a text in all the notes, and list the notes.")


        try:
            args = parser.parse_args(args)
        except:
            return

        # Subcomand to list the notes
        if args.listnotes:
            __notes__.list_notes()

        # Subcomand to delte a note
        elif args.deletenote:
            __notes__.delete_note(int(args.deletenote))
            __database__.root._p_changed = True

        # Subcomand to show a note
        elif args.show:
            __notes__.show_note(args.show)

        # Subcomand to edit a note
        elif args.edit >= 0:
            __notes__.edit_note(args.edit)
            __database__.root._p_changed = True

        # Subcomand to search a text
        elif args.search:
            __notes__.search_text(args.search)
Ejemplo n.º 4
0
    def cmd_notes(self, *args):
        parser = argparse.ArgumentParser(prog="notes", description="Manage notes", epilog="Manage notes")
        parser.add_argument('-l', '--listnotes', action="store_true", help="List all the notes in the system.")
        parser.add_argument('-d', '--deletenote', metavar="note_id", help="Delete a note.")
        parser.add_argument('-f', '--filter', metavar="filter", nargs = '+', help="Use this filter to work with notes. You can use multiple filter separated by a space. Format: \"variable[=<>]value\". You can use the variables: text. For example: -f text=hi text!=p2p.")
        parser.add_argument('-s', '--show', type=int, metavar="note_id", help="Show this note id.")
        parser.add_argument('-e', '--edit', type=int, metavar="note_id", help="Edit this note id.")
        parser.add_argument('-S', '--search', type=str, metavar="text", help="Search a text in all the notes, and list the notes.")


        try:
            args = parser.parse_args(args)
        except:
            return

        # Subcomand to list the notes
        if args.listnotes:
            __notes__.list_notes()

        # Subcomand to delte a note
        elif args.deletenote:
            __notes__.delete_note(int(args.deletenote))
            __database__.root._p_changed = True

        # Subcomand to show a note
        elif args.show:
            __notes__.show_note(args.show)

        # Subcomand to edit a note
        elif args.edit >= 0:
            __notes__.edit_note(args.edit)
            __database__.root._p_changed = True

        # Subcomand to search a text
        elif args.search:
            __notes__.search_text(args.search)
 def edit_note(self, note_id):
     """ Edit a note """
     __notes__.edit_note(note_id)
Ejemplo n.º 6
0
 def edit_note(self, note_id):
     """ Edit a note """
     __notes__.edit_note(note_id)