Move mopidy.utils.{ => log}.indent
This commit is contained in:
parent
301344d358
commit
1ae172d0c1
@ -3,7 +3,7 @@ import logging
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
from mopidy.frontends.mpd.protocol import ENCODING, LINE_TERMINATOR, VERSION
|
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
|
from mopidy.utils.process import pickle_connection
|
||||||
|
|
||||||
logger = logging.getLogger('mopidy.frontends.mpd.session')
|
logger = logging.getLogger('mopidy.frontends.mpd.session')
|
||||||
|
|||||||
@ -27,12 +27,3 @@ def get_class(name):
|
|||||||
except (ImportError, AttributeError):
|
except (ImportError, AttributeError):
|
||||||
raise ImportError("Couldn't load: %s" % name)
|
raise ImportError("Couldn't load: %s" % name)
|
||||||
return class_object
|
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
|
|
||||||
|
|||||||
@ -26,3 +26,11 @@ def setup_dump_logging():
|
|||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
root.addHandler(handler)
|
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
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from mopidy import SettingsError
|
from mopidy import SettingsError
|
||||||
from mopidy.utils import indent
|
from mopidy.utils.log import indent
|
||||||
|
|
||||||
logger = logging.getLogger('mopidy.utils.settings')
|
logger = logging.getLogger('mopidy.utils.settings')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user