Move get_mpd_protocol_version() into MPD frontend

This commit is contained in:
Stein Magnus Jodal 2010-08-20 00:44:09 +02:00
parent 5e10ad0e05
commit 222982e444
3 changed files with 5 additions and 6 deletions

View File

@ -5,9 +5,6 @@ if not (2, 6) <= sys.version_info < (3,):
def get_version():
return u'0.1.0a4'
def get_mpd_protocol_version():
return u'0.16.0'
class MopidyException(Exception):
def __init__(self, message, *args, **kwargs):
super(MopidyException, self).__init__(message, *args, **kwargs)

View File

@ -18,6 +18,9 @@ ENCODING = u'utf-8'
#: The MPD protocol uses ``\n`` as line terminator.
LINE_TERMINATOR = u'\n'
#: The MPD protocol version is 0.16.0.
VERSION = u'0.16.0'
mpd_commands = set()
request_handlers = {}

View File

@ -2,10 +2,9 @@ import asynchat
import logging
import multiprocessing
from mopidy import get_mpd_protocol_version
from mopidy.frontends.mpd.protocol import ENCODING, LINE_TERMINATOR, VERSION
from mopidy.process import pickle_connection
from mopidy.utils import indent
from .protocol import ENCODING, LINE_TERMINATOR
logger = logging.getLogger('mopidy.frontends.mpd.session')
@ -27,7 +26,7 @@ class MpdSession(asynchat.async_chat):
def start(self):
"""Start a new client session."""
self.send_response(u'OK MPD %s' % get_mpd_protocol_version())
self.send_response(u'OK MPD %s' % VERSION)
def collect_incoming_data(self, data):
"""Collect incoming data into buffer until a terminator is found."""