Move mopidy.utils.{ => log}.indent

This commit is contained in:
Stein Magnus Jodal 2010-08-20 16:38:59 +02:00
parent 301344d358
commit 1ae172d0c1
4 changed files with 10 additions and 11 deletions

View File

@ -3,7 +3,7 @@ import logging
import multiprocessing
from mopidy.frontends.mpd.protocol import ENCODING, LINE_TERMINATOR, VERSION
from mopidy.utils import indent
from mopidy.utils.log import indent
from mopidy.utils.process import pickle_connection
logger = logging.getLogger('mopidy.frontends.mpd.session')

View File

@ -27,12 +27,3 @@ def get_class(name):
except (ImportError, AttributeError):
raise ImportError("Couldn't load: %s" % name)
return class_object
def indent(string, places=4, linebreak='\n'):
lines = string.split(linebreak)
if len(lines) == 1:
return string
result = u''
for line in lines:
result += linebreak + ' ' * places + line
return result

View File

@ -26,3 +26,11 @@ def setup_dump_logging():
handler.setFormatter(formatter)
root.addHandler(handler)
def indent(string, places=4, linebreak='\n'):
lines = string.split(linebreak)
if len(lines) == 1:
return string
result = u''
for line in lines:
result += linebreak + ' ' * places + line
return result

View File

@ -6,7 +6,7 @@ import os
import sys
from mopidy import SettingsError
from mopidy.utils import indent
from mopidy.utils.log import indent
logger = logging.getLogger('mopidy.utils.settings')