diff --git a/mopidy/frontends/mpd/protocol/audio_output.py b/mopidy/frontends/mpd/protocol/audio_output.py index 595ca508..ee1782bd 100644 --- a/mopidy/frontends/mpd/protocol/audio_output.py +++ b/mopidy/frontends/mpd/protocol/audio_output.py @@ -4,7 +4,7 @@ from mopidy.frontends.mpd.exceptions import MpdNoExistError from mopidy.frontends.mpd.protocol import handle_request -@handle_request(r'^disableoutput\ "(?P\d+)"$') +@handle_request(r'disableoutput\ "(?P\d+)"$') def disableoutput(context, outputid): """ *musicpd.org, audio output section:* @@ -19,7 +19,7 @@ def disableoutput(context, outputid): raise MpdNoExistError('No such audio output', command='disableoutput') -@handle_request(r'^enableoutput\ "(?P\d+)"$') +@handle_request(r'enableoutput\ "(?P\d+)"$') def enableoutput(context, outputid): """ *musicpd.org, audio output section:* @@ -34,7 +34,7 @@ def enableoutput(context, outputid): raise MpdNoExistError('No such audio output', command='enableoutput') -@handle_request(r'^outputs$') +@handle_request(r'outputs$') def outputs(context): """ *musicpd.org, audio output section:* diff --git a/mopidy/frontends/mpd/protocol/channels.py b/mopidy/frontends/mpd/protocol/channels.py index 6d67e52c..1f54a41b 100644 --- a/mopidy/frontends/mpd/protocol/channels.py +++ b/mopidy/frontends/mpd/protocol/channels.py @@ -4,7 +4,7 @@ from mopidy.frontends.mpd.protocol import handle_request from mopidy.frontends.mpd.exceptions import MpdNotImplemented -@handle_request(r'^subscribe\ "(?P[A-Za-z0-9:._-]+)"$') +@handle_request(r'subscribe\ "(?P[A-Za-z0-9:._-]+)"$') def subscribe(context, channel): """ *musicpd.org, client to client section:* @@ -18,7 +18,7 @@ def subscribe(context, channel): raise MpdNotImplemented # TODO -@handle_request(r'^unsubscribe\ "(?P[A-Za-z0-9:._-]+)"$') +@handle_request(r'unsubscribe\ "(?P[A-Za-z0-9:._-]+)"$') def unsubscribe(context, channel): """ *musicpd.org, client to client section:* @@ -30,7 +30,7 @@ def unsubscribe(context, channel): raise MpdNotImplemented # TODO -@handle_request(r'^channels$') +@handle_request(r'channels$') def channels(context): """ *musicpd.org, client to client section:* @@ -43,7 +43,7 @@ def channels(context): raise MpdNotImplemented # TODO -@handle_request(r'^readmessages$') +@handle_request(r'readmessages$') def readmessages(context): """ *musicpd.org, client to client section:* @@ -57,7 +57,7 @@ def readmessages(context): @handle_request( - r'^sendmessage\ "(?P[A-Za-z0-9:._-]+)"\ "(?P[^"]*)"$') + r'sendmessage\ "(?P[A-Za-z0-9:._-]+)"\ "(?P[^"]*)"$') def sendmessage(context, channel, text): """ *musicpd.org, client to client section:* diff --git a/mopidy/frontends/mpd/protocol/command_list.py b/mopidy/frontends/mpd/protocol/command_list.py index 8d5769ef..c85a594b 100644 --- a/mopidy/frontends/mpd/protocol/command_list.py +++ b/mopidy/frontends/mpd/protocol/command_list.py @@ -4,7 +4,7 @@ from mopidy.frontends.mpd.protocol import handle_request from mopidy.frontends.mpd.exceptions import MpdUnknownCommand -@handle_request(r'^command_list_begin$') +@handle_request(r'command_list_begin$') def command_list_begin(context): """ *musicpd.org, command list section:* @@ -26,7 +26,7 @@ def command_list_begin(context): context.dispatcher.command_list = [] -@handle_request(r'^command_list_end$') +@handle_request(r'command_list_end$') def command_list_end(context): """See :meth:`command_list_begin()`.""" if not context.dispatcher.command_list_receiving: @@ -49,7 +49,7 @@ def command_list_end(context): return command_list_response -@handle_request(r'^command_list_ok_begin$') +@handle_request(r'command_list_ok_begin$') def command_list_ok_begin(context): """See :meth:`command_list_begin()`.""" context.dispatcher.command_list_receiving = True diff --git a/mopidy/frontends/mpd/protocol/connection.py b/mopidy/frontends/mpd/protocol/connection.py index eb5df90b..734ed37a 100644 --- a/mopidy/frontends/mpd/protocol/connection.py +++ b/mopidy/frontends/mpd/protocol/connection.py @@ -5,7 +5,7 @@ from mopidy.frontends.mpd.exceptions import ( MpdPasswordError, MpdPermissionError) -@handle_request(r'^close$', auth_required=False) +@handle_request(r'close$', auth_required=False) def close(context): """ *musicpd.org, connection section:* @@ -17,7 +17,7 @@ def close(context): context.session.close() -@handle_request(r'^kill$') +@handle_request(r'kill$') def kill(context): """ *musicpd.org, connection section:* @@ -29,7 +29,7 @@ def kill(context): raise MpdPermissionError(command='kill') -@handle_request(r'^password\ "(?P[^"]+)"$', auth_required=False) +@handle_request(r'password\ "(?P[^"]+)"$', auth_required=False) def password_(context, password): """ *musicpd.org, connection section:* @@ -45,7 +45,7 @@ def password_(context, password): raise MpdPasswordError('incorrect password', command='password') -@handle_request(r'^ping$', auth_required=False) +@handle_request(r'ping$', auth_required=False) def ping(context): """ *musicpd.org, connection section:* diff --git a/mopidy/frontends/mpd/protocol/current_playlist.py b/mopidy/frontends/mpd/protocol/current_playlist.py index 1eaf0649..c514538c 100644 --- a/mopidy/frontends/mpd/protocol/current_playlist.py +++ b/mopidy/frontends/mpd/protocol/current_playlist.py @@ -6,7 +6,7 @@ from mopidy.frontends.mpd.exceptions import ( from mopidy.frontends.mpd.protocol import handle_request -@handle_request(r'^add\ "(?P[^"]*)"$') +@handle_request(r'add\ "(?P[^"]*)"$') def add(context, uri): """ *musicpd.org, current playlist section:* @@ -27,7 +27,7 @@ def add(context, uri): raise MpdNoExistError('directory or file not found', command='add') -@handle_request(r'^addid\ "(?P[^"]*)"(\ "(?P\d+)")*$') +@handle_request(r'addid\ "(?P[^"]*)"(\ "(?P\d+)")*$') def addid(context, uri, songpos=None): """ *musicpd.org, current playlist section:* @@ -58,7 +58,7 @@ def addid(context, uri, songpos=None): return ('Id', tl_tracks[0].tlid) -@handle_request(r'^delete\ "(?P\d+):(?P\d+)*"$') +@handle_request(r'delete\ "(?P\d+):(?P\d+)*"$') def delete_range(context, start, end=None): """ *musicpd.org, current playlist section:* @@ -79,7 +79,7 @@ def delete_range(context, start, end=None): context.core.tracklist.remove(tlid=[tlid]) -@handle_request(r'^delete\ "(?P\d+)"$') +@handle_request(r'delete\ "(?P\d+)"$') def delete_songpos(context, songpos): """See :meth:`delete_range`""" try: @@ -91,7 +91,7 @@ def delete_songpos(context, songpos): raise MpdArgError('Bad song index', command='delete') -@handle_request(r'^deleteid\ "(?P\d+)"$') +@handle_request(r'deleteid\ "(?P\d+)"$') def deleteid(context, tlid): """ *musicpd.org, current playlist section:* @@ -106,7 +106,7 @@ def deleteid(context, tlid): raise MpdNoExistError('No such song', command='deleteid') -@handle_request(r'^clear$') +@handle_request(r'clear$') def clear(context): """ *musicpd.org, current playlist section:* @@ -118,7 +118,7 @@ def clear(context): context.core.tracklist.clear() -@handle_request(r'^move\ "(?P\d+):(?P\d+)*"\ "(?P\d+)"$') +@handle_request(r'move\ "(?P\d+):(?P\d+)*"\ "(?P\d+)"$') def move_range(context, start, to, end=None): """ *musicpd.org, current playlist section:* @@ -136,7 +136,7 @@ def move_range(context, start, to, end=None): context.core.tracklist.move(start, end, to) -@handle_request(r'^move\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'move\ "(?P\d+)"\ "(?P\d+)"$') def move_songpos(context, songpos, to): """See :meth:`move_range`.""" songpos = int(songpos) @@ -144,7 +144,7 @@ def move_songpos(context, songpos, to): context.core.tracklist.move(songpos, songpos + 1, to) -@handle_request(r'^moveid\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'moveid\ "(?P\d+)"\ "(?P\d+)"$') def moveid(context, tlid, to): """ *musicpd.org, current playlist section:* @@ -164,7 +164,7 @@ def moveid(context, tlid, to): context.core.tracklist.move(position, position + 1, to) -@handle_request(r'^playlist$') +@handle_request(r'playlist$') def playlist(context): """ *musicpd.org, current playlist section:* @@ -180,8 +180,8 @@ def playlist(context): return playlistinfo(context) -@handle_request(r'^playlistfind\ (?P[^"]+)\ "(?P[^"]+)"$') -@handle_request(r'^playlistfind\ "(?P[^"]+)"\ "(?P[^"]+)"$') +@handle_request(r'playlistfind\ (?P[^"]+)\ "(?P[^"]+)"$') +@handle_request(r'playlistfind\ "(?P[^"]+)"\ "(?P[^"]+)"$') def playlistfind(context, tag, needle): """ *musicpd.org, current playlist section:* @@ -203,7 +203,7 @@ def playlistfind(context, tag, needle): raise MpdNotImplemented # TODO -@handle_request(r'^playlistid(\ "(?P\d+)")*$') +@handle_request(r'playlistid(\ "(?P\d+)")*$') def playlistid(context, tlid=None): """ *musicpd.org, current playlist section:* @@ -225,9 +225,9 @@ def playlistid(context, tlid=None): context.core.tracklist.tl_tracks.get()) -@handle_request(r'^playlistinfo$') -@handle_request(r'^playlistinfo\ "(?P-?\d+)"$') -@handle_request(r'^playlistinfo\ "(?P\d+):(?P\d+)*"$') +@handle_request(r'playlistinfo$') +@handle_request(r'playlistinfo\ "(?P-?\d+)"$') +@handle_request(r'playlistinfo\ "(?P\d+):(?P\d+)*"$') def playlistinfo(context, songpos=None, start=None, end=None): """ *musicpd.org, current playlist section:* @@ -263,8 +263,8 @@ def playlistinfo(context, songpos=None, start=None, end=None): return translator.tracks_to_mpd_format(tl_tracks, start, end) -@handle_request(r'^playlistsearch\ "(?P[^"]+)"\ "(?P[^"]+)"$') -@handle_request(r'^playlistsearch\ (?P\w+)\ "(?P[^"]+)"$') +@handle_request(r'playlistsearch\ "(?P[^"]+)"\ "(?P[^"]+)"$') +@handle_request(r'playlistsearch\ (?P\w+)\ "(?P[^"]+)"$') def playlistsearch(context, tag, needle): """ *musicpd.org, current playlist section:* @@ -282,8 +282,8 @@ def playlistsearch(context, tag, needle): raise MpdNotImplemented # TODO -@handle_request(r'^plchanges\ (?P-?\d+)$') -@handle_request(r'^plchanges\ "(?P-?\d+)"$') +@handle_request(r'plchanges\ (?P-?\d+)$') +@handle_request(r'plchanges\ "(?P-?\d+)"$') def plchanges(context, version): """ *musicpd.org, current playlist section:* @@ -305,7 +305,7 @@ def plchanges(context, version): context.core.tracklist.tl_tracks.get()) -@handle_request(r'^plchangesposid\ "(?P\d+)"$') +@handle_request(r'plchangesposid\ "(?P\d+)"$') def plchangesposid(context, version): """ *musicpd.org, current playlist section:* @@ -329,8 +329,8 @@ def plchangesposid(context, version): return result -@handle_request(r'^shuffle$') -@handle_request(r'^shuffle\ "(?P\d+):(?P\d+)*"$') +@handle_request(r'shuffle$') +@handle_request(r'shuffle\ "(?P\d+):(?P\d+)*"$') def shuffle(context, start=None, end=None): """ *musicpd.org, current playlist section:* @@ -347,7 +347,7 @@ def shuffle(context, start=None, end=None): context.core.tracklist.shuffle(start, end) -@handle_request(r'^swap\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'swap\ "(?P\d+)"\ "(?P\d+)"$') def swap(context, songpos1, songpos2): """ *musicpd.org, current playlist section:* @@ -369,7 +369,7 @@ def swap(context, songpos1, songpos2): context.core.tracklist.add(tracks) -@handle_request(r'^swapid\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'swapid\ "(?P\d+)"\ "(?P\d+)"$') def swapid(context, tlid1, tlid2): """ *musicpd.org, current playlist section:* diff --git a/mopidy/frontends/mpd/protocol/empty.py b/mopidy/frontends/mpd/protocol/empty.py index 03fd3df3..b2bb9482 100644 --- a/mopidy/frontends/mpd/protocol/empty.py +++ b/mopidy/frontends/mpd/protocol/empty.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals from mopidy.frontends.mpd.protocol import handle_request -@handle_request(r'^[\ ]*$') +@handle_request(r'[\ ]*$') def empty(context): """The original MPD server returns ``OK`` on an empty request.""" pass diff --git a/mopidy/frontends/mpd/protocol/music_db.py b/mopidy/frontends/mpd/protocol/music_db.py index 1ef9cc78..85f80ad9 100644 --- a/mopidy/frontends/mpd/protocol/music_db.py +++ b/mopidy/frontends/mpd/protocol/music_db.py @@ -40,7 +40,7 @@ def _artist_as_track(artist): artists=[artist]) -@handle_request(r'^count\ ' + QUERY_RE) +@handle_request(r'count\ ' + QUERY_RE) def count(context, mpd_query): """ *musicpd.org, music database section:* @@ -67,7 +67,7 @@ def count(context, mpd_query): ] -@handle_request(r'^find\ ' + QUERY_RE) +@handle_request(r'find\ ' + QUERY_RE) def find(context, mpd_query): """ *musicpd.org, music database section:* @@ -112,7 +112,7 @@ def find(context, mpd_query): return translator.tracks_to_mpd_format(result_tracks) -@handle_request(r'^findadd\ ' + QUERY_RE) +@handle_request(r'findadd\ ' + QUERY_RE) def findadd(context, mpd_query): """ *musicpd.org, music database section:* @@ -131,7 +131,7 @@ def findadd(context, mpd_query): @handle_request( - r'^list\ "?(?P([Aa]rtist|[Aa]lbumartist|[Aa]lbum|[Cc]omposer|' + r'list\ "?(?P([Aa]rtist|[Aa]lbumartist|[Aa]lbum|[Cc]omposer|' r'[Dd]ate|[Gg]enre|[Pp]erformer))"?' r'(\ (?P.*))?$') def list_(context, field, mpd_query=None): @@ -305,8 +305,8 @@ def _list_genre(context, query): return genres -@handle_request(r'^listall$') -@handle_request(r'^listall\ "(?P[^"]+)"$') +@handle_request(r'listall$') +@handle_request(r'listall\ "(?P[^"]+)"$') def listall(context, uri=None): """ *musicpd.org, music database section:* @@ -318,8 +318,8 @@ def listall(context, uri=None): raise MpdNotImplemented # TODO -@handle_request(r'^listallinfo$') -@handle_request(r'^listallinfo\ "(?P[^"]+)"$') +@handle_request(r'listallinfo$') +@handle_request(r'listallinfo\ "(?P[^"]+)"$') def listallinfo(context, uri=None): """ *musicpd.org, music database section:* @@ -332,8 +332,8 @@ def listallinfo(context, uri=None): raise MpdNotImplemented # TODO -@handle_request(r'^lsinfo$') -@handle_request(r'^lsinfo\ "(?P[^"]*)"$') +@handle_request(r'lsinfo$') +@handle_request(r'lsinfo\ "(?P[^"]*)"$') def lsinfo(context, uri=None): """ *musicpd.org, music database section:* @@ -355,7 +355,7 @@ def lsinfo(context, uri=None): raise MpdNotImplemented # TODO -@handle_request(r'^rescan(\ "(?P[^"]+)")*$') +@handle_request(r'rescan(\ "(?P[^"]+)")*$') def rescan(context, uri=None): """ *musicpd.org, music database section:* @@ -367,7 +367,7 @@ def rescan(context, uri=None): return update(context, uri, rescan_unmodified_files=True) -@handle_request(r'^search\ ' + QUERY_RE) +@handle_request(r'search\ ' + QUERY_RE) def search(context, mpd_query): """ *musicpd.org, music database section:* @@ -406,7 +406,7 @@ def search(context, mpd_query): return translator.tracks_to_mpd_format(artists + albums + tracks) -@handle_request(r'^searchadd\ ' + QUERY_RE) +@handle_request(r'searchadd\ ' + QUERY_RE) def searchadd(context, mpd_query): """ *musicpd.org, music database section:* @@ -427,7 +427,7 @@ def searchadd(context, mpd_query): context.core.tracklist.add(_get_tracks(results)) -@handle_request(r'^searchaddpl\ "(?P[^"]+)"\ ' + QUERY_RE) +@handle_request(r'searchaddpl\ "(?P[^"]+)"\ ' + QUERY_RE) def searchaddpl(context, playlist_name, mpd_query): """ *musicpd.org, music database section:* @@ -456,7 +456,7 @@ def searchaddpl(context, playlist_name, mpd_query): context.core.playlists.save(playlist) -@handle_request(r'^update(\ "(?P[^"]+)")*$') +@handle_request(r'update(\ "(?P[^"]+)")*$') def update(context, uri=None, rescan_unmodified_files=False): """ *musicpd.org, music database section:* diff --git a/mopidy/frontends/mpd/protocol/playback.py b/mopidy/frontends/mpd/protocol/playback.py index 1538ca7d..28772dde 100644 --- a/mopidy/frontends/mpd/protocol/playback.py +++ b/mopidy/frontends/mpd/protocol/playback.py @@ -6,8 +6,8 @@ from mopidy.frontends.mpd.exceptions import ( MpdArgError, MpdNoExistError, MpdNotImplemented) -@handle_request(r'^consume\ (?P[01])$') -@handle_request(r'^consume\ "(?P[01])"$') +@handle_request(r'consume\ (?P[01])$') +@handle_request(r'consume\ "(?P[01])"$') def consume(context, state): """ *musicpd.org, playback section:* @@ -24,7 +24,7 @@ def consume(context, state): context.core.tracklist.consume = False -@handle_request(r'^crossfade\ "(?P\d+)"$') +@handle_request(r'crossfade\ "(?P\d+)"$') def crossfade(context, seconds): """ *musicpd.org, playback section:* @@ -37,7 +37,7 @@ def crossfade(context, seconds): raise MpdNotImplemented # TODO -@handle_request(r'^next$') +@handle_request(r'next$') def next_(context): """ *musicpd.org, playback section:* @@ -95,8 +95,8 @@ def next_(context): return context.core.playback.next().get() -@handle_request(r'^pause$') -@handle_request(r'^pause\ "(?P[01])"$') +@handle_request(r'pause$') +@handle_request(r'pause\ "(?P[01])"$') def pause(context, state=None): """ *musicpd.org, playback section:* @@ -120,7 +120,7 @@ def pause(context, state=None): context.core.playback.resume() -@handle_request(r'^play$') +@handle_request(r'play$') def play(context): """ The original MPD server resumes from the paused state on ``play`` @@ -129,8 +129,8 @@ def play(context): return context.core.playback.play().get() -@handle_request(r'^playid\ (?P-?\d+)$') -@handle_request(r'^playid\ "(?P-?\d+)"$') +@handle_request(r'playid\ (?P-?\d+)$') +@handle_request(r'playid\ "(?P-?\d+)"$') def playid(context, tlid): """ *musicpd.org, playback section:* @@ -157,8 +157,8 @@ def playid(context, tlid): return context.core.playback.play(tl_tracks[0]).get() -@handle_request(r'^play\ (?P-?\d+)$') -@handle_request(r'^play\ "(?P-?\d+)"$') +@handle_request(r'play\ (?P-?\d+)$') +@handle_request(r'play\ "(?P-?\d+)"$') def playpos(context, songpos): """ *musicpd.org, playback section:* @@ -205,7 +205,7 @@ def _play_minus_one(context): return # Fail silently -@handle_request(r'^previous$') +@handle_request(r'previous$') def previous(context): """ *musicpd.org, playback section:* @@ -252,8 +252,8 @@ def previous(context): return context.core.playback.previous().get() -@handle_request(r'^random\ (?P[01])$') -@handle_request(r'^random\ "(?P[01])"$') +@handle_request(r'random\ (?P[01])$') +@handle_request(r'random\ "(?P[01])"$') def random(context, state): """ *musicpd.org, playback section:* @@ -268,8 +268,8 @@ def random(context, state): context.core.tracklist.random = False -@handle_request(r'^repeat\ (?P[01])$') -@handle_request(r'^repeat\ "(?P[01])"$') +@handle_request(r'repeat\ (?P[01])$') +@handle_request(r'repeat\ "(?P[01])"$') def repeat(context, state): """ *musicpd.org, playback section:* @@ -284,7 +284,7 @@ def repeat(context, state): context.core.tracklist.repeat = False -@handle_request(r'^replay_gain_mode\ "(?P(off|track|album))"$') +@handle_request(r'replay_gain_mode\ "(?P(off|track|album))"$') def replay_gain_mode(context, mode): """ *musicpd.org, playback section:* @@ -301,7 +301,7 @@ def replay_gain_mode(context, mode): raise MpdNotImplemented # TODO -@handle_request(r'^replay_gain_status$') +@handle_request(r'replay_gain_status$') def replay_gain_status(context): """ *musicpd.org, playback section:* @@ -314,8 +314,8 @@ def replay_gain_status(context): return 'off' # TODO -@handle_request(r'^seek\ (?P\d+)\ (?P\d+)$') -@handle_request(r'^seek\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'seek\ (?P\d+)\ (?P\d+)$') +@handle_request(r'seek\ "(?P\d+)"\ "(?P\d+)"$') def seek(context, songpos, seconds): """ *musicpd.org, playback section:* @@ -335,7 +335,7 @@ def seek(context, songpos, seconds): context.core.playback.seek(int(seconds) * 1000).get() -@handle_request(r'^seekid\ "(?P\d+)"\ "(?P\d+)"$') +@handle_request(r'seekid\ "(?P\d+)"\ "(?P\d+)"$') def seekid(context, tlid, seconds): """ *musicpd.org, playback section:* @@ -350,8 +350,8 @@ def seekid(context, tlid, seconds): context.core.playback.seek(int(seconds) * 1000).get() -@handle_request(r'^seekcur\ "(?P\d+)"$') -@handle_request(r'^seekcur\ "(?P[-+]\d+)"$') +@handle_request(r'seekcur\ "(?P\d+)"$') +@handle_request(r'seekcur\ "(?P[-+]\d+)"$') def seekcur(context, position=None, diff=None): """ *musicpd.org, playback section:* @@ -370,8 +370,8 @@ def seekcur(context, position=None, diff=None): context.core.playback.seek(position).get() -@handle_request(r'^setvol\ (?P[-+]*\d+)$') -@handle_request(r'^setvol\ "(?P[-+]*\d+)"$') +@handle_request(r'setvol\ (?P[-+]*\d+)$') +@handle_request(r'setvol\ "(?P[-+]*\d+)"$') def setvol(context, volume): """ *musicpd.org, playback section:* @@ -392,8 +392,8 @@ def setvol(context, volume): context.core.playback.volume = volume -@handle_request(r'^single\ (?P[01])$') -@handle_request(r'^single\ "(?P[01])"$') +@handle_request(r'single\ (?P[01])$') +@handle_request(r'single\ "(?P[01])"$') def single(context, state): """ *musicpd.org, playback section:* @@ -410,7 +410,7 @@ def single(context, state): context.core.tracklist.single = False -@handle_request(r'^stop$') +@handle_request(r'stop$') def stop(context): """ *musicpd.org, playback section:* diff --git a/mopidy/frontends/mpd/protocol/reflection.py b/mopidy/frontends/mpd/protocol/reflection.py index cc1c7222..d5206120 100644 --- a/mopidy/frontends/mpd/protocol/reflection.py +++ b/mopidy/frontends/mpd/protocol/reflection.py @@ -4,7 +4,7 @@ from mopidy.frontends.mpd.exceptions import MpdPermissionError from mopidy.frontends.mpd.protocol import handle_request, mpd_commands -@handle_request(r'^config$', auth_required=False) +@handle_request(r'config$', auth_required=False) def config(context): """ *musicpd.org, reflection section:* @@ -18,7 +18,7 @@ def config(context): raise MpdPermissionError(command='config') -@handle_request(r'^commands$', auth_required=False) +@handle_request(r'commands$', auth_required=False) def commands(context): """ *musicpd.org, reflection section:* @@ -45,7 +45,7 @@ def commands(context): ('command', command_name) for command_name in sorted(command_names)] -@handle_request(r'^decoders$') +@handle_request(r'decoders$') def decoders(context): """ *musicpd.org, reflection section:* @@ -72,7 +72,7 @@ def decoders(context): return # TODO -@handle_request(r'^notcommands$', auth_required=False) +@handle_request(r'notcommands$', auth_required=False) def notcommands(context): """ *musicpd.org, reflection section:* @@ -95,7 +95,7 @@ def notcommands(context): ('command', command_name) for command_name in sorted(command_names)] -@handle_request(r'^tagtypes$') +@handle_request(r'tagtypes$') def tagtypes(context): """ *musicpd.org, reflection section:* @@ -107,7 +107,7 @@ def tagtypes(context): pass # TODO -@handle_request(r'^urlhandlers$') +@handle_request(r'urlhandlers$') def urlhandlers(context): """ *musicpd.org, reflection section:* diff --git a/mopidy/frontends/mpd/protocol/status.py b/mopidy/frontends/mpd/protocol/status.py index 586c93a5..2fe3a402 100644 --- a/mopidy/frontends/mpd/protocol/status.py +++ b/mopidy/frontends/mpd/protocol/status.py @@ -13,7 +13,7 @@ SUBSYSTEMS = [ 'stored_playlist', 'update'] -@handle_request(r'^clearerror$') +@handle_request(r'clearerror$') def clearerror(context): """ *musicpd.org, status section:* @@ -26,7 +26,7 @@ def clearerror(context): raise MpdNotImplemented # TODO -@handle_request(r'^currentsong$') +@handle_request(r'currentsong$') def currentsong(context): """ *musicpd.org, status section:* @@ -42,8 +42,8 @@ def currentsong(context): return track_to_mpd_format(tl_track, position=position) -@handle_request(r'^idle$') -@handle_request(r'^idle\ (?P.+)$') +@handle_request(r'idle$') +@handle_request(r'idle\ (?P.+)$') def idle(context, subsystems=None): """ *musicpd.org, status section:* @@ -100,7 +100,7 @@ def idle(context, subsystems=None): return response -@handle_request(r'^noidle$') +@handle_request(r'noidle$') def noidle(context): """See :meth:`_status_idle`.""" if not context.subscriptions: @@ -110,7 +110,7 @@ def noidle(context): context.session.prevent_timeout = False -@handle_request(r'^stats$') +@handle_request(r'stats$') def stats(context): """ *musicpd.org, status section:* @@ -137,7 +137,7 @@ def stats(context): } -@handle_request(r'^status$') +@handle_request(r'status$') def status(context): """ *musicpd.org, status section:* diff --git a/mopidy/frontends/mpd/protocol/stickers.py b/mopidy/frontends/mpd/protocol/stickers.py index 48187fa0..84417e51 100644 --- a/mopidy/frontends/mpd/protocol/stickers.py +++ b/mopidy/frontends/mpd/protocol/stickers.py @@ -5,7 +5,7 @@ from mopidy.frontends.mpd.exceptions import MpdNotImplemented @handle_request( - r'^sticker\ delete\ "(?P[^"]+)"\ ' + r'sticker\ delete\ "(?P[^"]+)"\ ' r'"(?P[^"]+)"(\ "(?P[^"]+)")*$') def sticker_delete(context, field, uri, name=None): """ @@ -20,7 +20,7 @@ def sticker_delete(context, field, uri, name=None): @handle_request( - r'^sticker\ find\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' + r'sticker\ find\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' r'"(?P[^"]+)"$') def sticker_find(context, field, uri, name): """ @@ -36,7 +36,7 @@ def sticker_find(context, field, uri, name): @handle_request( - r'^sticker\ get\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' + r'sticker\ get\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' r'"(?P[^"]+)"$') def sticker_get(context, field, uri, name): """ @@ -49,7 +49,7 @@ def sticker_get(context, field, uri, name): raise MpdNotImplemented # TODO -@handle_request(r'^sticker\ list\ "(?P[^"]+)"\ "(?P[^"]+)"$') +@handle_request(r'sticker\ list\ "(?P[^"]+)"\ "(?P[^"]+)"$') def sticker_list(context, field, uri): """ *musicpd.org, sticker section:* @@ -62,7 +62,7 @@ def sticker_list(context, field, uri): @handle_request( - r'^sticker\ set\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' + r'sticker\ set\ "(?P[^"]+)"\ "(?P[^"]+)"\ ' r'"(?P[^"]+)"\ "(?P[^"]+)"$') def sticker_set(context, field, uri, name, value): """ diff --git a/mopidy/frontends/mpd/protocol/stored_playlists.py b/mopidy/frontends/mpd/protocol/stored_playlists.py index 5d0778c9..1ac12864 100644 --- a/mopidy/frontends/mpd/protocol/stored_playlists.py +++ b/mopidy/frontends/mpd/protocol/stored_playlists.py @@ -7,8 +7,8 @@ from mopidy.frontends.mpd.protocol import handle_request from mopidy.frontends.mpd.translator import playlist_to_mpd_format -@handle_request(r'^listplaylist\ (?P\w+)$') -@handle_request(r'^listplaylist\ "(?P[^"]+)"$') +@handle_request(r'listplaylist\ (?P\w+)$') +@handle_request(r'listplaylist\ "(?P[^"]+)"$') def listplaylist(context, name): """ *musicpd.org, stored playlists section:* @@ -29,8 +29,8 @@ def listplaylist(context, name): return ['file: %s' % t.uri for t in playlist.tracks] -@handle_request(r'^listplaylistinfo\ (?P\w+)$') -@handle_request(r'^listplaylistinfo\ "(?P[^"]+)"$') +@handle_request(r'listplaylistinfo\ (?P\w+)$') +@handle_request(r'listplaylistinfo\ "(?P[^"]+)"$') def listplaylistinfo(context, name): """ *musicpd.org, stored playlists section:* @@ -50,7 +50,7 @@ def listplaylistinfo(context, name): return playlist_to_mpd_format(playlist) -@handle_request(r'^listplaylists$') +@handle_request(r'listplaylists$') def listplaylists(context): """ *musicpd.org, stored playlists section:* @@ -93,7 +93,7 @@ def listplaylists(context): @handle_request( - r'^load\ "(?P[^"]+)"(\ "(?P\d+):(?P\d+)*")*$') + r'load\ "(?P[^"]+)"(\ "(?P\d+):(?P\d+)*")*$') def load(context, name, start=None, end=None): """ *musicpd.org, stored playlists section:* @@ -125,7 +125,7 @@ def load(context, name, start=None, end=None): context.core.tracklist.add(playlist.tracks[start:end]) -@handle_request(r'^playlistadd\ "(?P[^"]+)"\ "(?P[^"]+)"$') +@handle_request(r'playlistadd\ "(?P[^"]+)"\ "(?P[^"]+)"$') def playlistadd(context, name, uri): """ *musicpd.org, stored playlists section:* @@ -139,7 +139,7 @@ def playlistadd(context, name, uri): raise MpdNotImplemented # TODO -@handle_request(r'^playlistclear\ "(?P[^"]+)"$') +@handle_request(r'playlistclear\ "(?P[^"]+)"$') def playlistclear(context, name): """ *musicpd.org, stored playlists section:* @@ -151,7 +151,7 @@ def playlistclear(context, name): raise MpdNotImplemented # TODO -@handle_request(r'^playlistdelete\ "(?P[^"]+)"\ "(?P\d+)"$') +@handle_request(r'playlistdelete\ "(?P[^"]+)"\ "(?P\d+)"$') def playlistdelete(context, name, songpos): """ *musicpd.org, stored playlists section:* @@ -164,7 +164,7 @@ def playlistdelete(context, name, songpos): @handle_request( - r'^playlistmove\ "(?P[^"]+)"\ ' + r'playlistmove\ "(?P[^"]+)"\ ' r'"(?P\d+)"\ "(?P\d+)"$') def playlistmove(context, name, from_pos, to_pos): """ @@ -184,7 +184,7 @@ def playlistmove(context, name, from_pos, to_pos): raise MpdNotImplemented # TODO -@handle_request(r'^rename\ "(?P[^"]+)"\ "(?P[^"]+)"$') +@handle_request(r'rename\ "(?P[^"]+)"\ "(?P[^"]+)"$') def rename(context, old_name, new_name): """ *musicpd.org, stored playlists section:* @@ -196,7 +196,7 @@ def rename(context, old_name, new_name): raise MpdNotImplemented # TODO -@handle_request(r'^rm\ "(?P[^"]+)"$') +@handle_request(r'rm\ "(?P[^"]+)"$') def rm(context, name): """ *musicpd.org, stored playlists section:* @@ -208,7 +208,7 @@ def rm(context, name): raise MpdNotImplemented # TODO -@handle_request(r'^save\ "(?P[^"]+)"$') +@handle_request(r'save\ "(?P[^"]+)"$') def save(context, name): """ *musicpd.org, stored playlists section:*