X-Git-Url: http://git.tremily.us/?p=hooke.git;a=blobdiff_plain;f=hooke%2Fplugin%2Fplaylist.py;h=ed904c640839dab6c78394c252839727a08768b6;hp=086fa971e5155c42647033cb54da500d0097a156;hb=f760ade28f417e1b83a057ace84edbdcda2939f8;hpb=12030346bd947f640b222f7b84eb2a626ed3a111 diff --git a/hooke/plugin/playlist.py b/hooke/plugin/playlist.py index 086fa97..ed904c6 100644 --- a/hooke/plugin/playlist.py +++ b/hooke/plugin/playlist.py @@ -38,7 +38,7 @@ class PlaylistPlugin (Builtin): self._commands = [ NextCommand(self), PreviousCommand(self), JumpCommand(self), GetCommand(self), IndexCommand(self), CurveListCommand(self), - SaveCommand(self), LoadCommand(self), + NameCommand(self), SaveCommand(self), LoadCommand(self), AddCommand(self), AddGlobCommand(self), RemoveCommand(self), ApplyCommand(self), FilterCommand(self), @@ -210,6 +210,26 @@ class CurveListCommand (PlaylistCommand): outqueue.put(list(self._playlist(hooke, params))) +class NameCommand (PlaylistCommand): + """(Re)name a playlist. + """ + def __init__(self, plugin): + super(NameCommand, self).__init__( + name='name playlist', + arguments=[ + Argument(name='name', type='string', optional=False, + help=""" +Name for the playlist. +""".strip()), + ], + help=self.__doc__, plugin=plugin) + + def _run(self, hooke, inqueue, outqueue, params): + p = self._playlist(hooke, params) + p.name = params['name'] + outqueue.put(p) + + class SaveCommand (PlaylistCommand): """Save a playlist. """