@save<EOL><INDENT>@load<EOL>def edit(<EOL>self, index, name=None, priority=None,<EOL>comment=None, done=None, parent=None<EOL>):<DEDENT>
if parent == -<NUM_LIT:1>:<EOL><INDENT>parent = '<STR_LIT>'<EOL><DEDENT>parent = self._split(parent)<EOL>index = self._split(index)<EOL>item = self.data<EOL>for j, c in enumerate(index):<EOL><INDENT>item = item[int(c) - <NUM_LIT:1>]<EOL>if j + <NUM_LIT:1> != len(index):<EOL><INDENT>item = item[<NUM_LIT:4>]<EOL><DEDENT><DEDENT>if name is not None:<EOL><INDENT>item[<NUM_LIT:0>] = name<EOL><DEDENT>if priority is not None:<EOL><INDENT>item[<NUM_LIT:1>] = priority<EOL><DEDENT>if comment is not None:<EOL><INDENT>item[<NUM_LIT:2>] = comment<EOL><DEDENT>if done is not None:<EOL><INDENT>item[<NUM_LIT:3>] = done<EOL><DEDENT>if parent is not None and parent != index[:-<NUM_LIT:1>]:<EOL><INDENT>parentitem = self.data<EOL>for c in parent:<EOL><INDENT>parentitem = parentitem[int(c) - <NUM_LIT:1>][<NUM_LIT:4>]<EOL><DEDENT>parentitem.append(item)<EOL>parent = index[:-<NUM_LIT:1>]<EOL>parentitem = self.data<EOL>for c in parent:<EOL><INDENT>parentitem = parentitem[int(c) - <NUM_LIT:1>][<NUM_LIT:4>]<EOL><DEDENT>parentitem.remove(item)<EOL><DEDENT>
Modifies :index: to specified data.

        Every argument, which is not None, will get changed.

        If parent is not None, the item will get reparented.
        Use parent=-1 or parent='' for reparenting to top-level.

        :index: Index of the item to edit.
        :name: New name.
        :priority: New priority.
        :comment: New comment.
        :done: Done mark.
        :parent: New parent.