|
a/src/mediaserver/cdplugins/pycommon/upmplgutils.py |
|
b/src/mediaserver/cdplugins/pycommon/upmplgutils.py |
|
... |
|
... |
28 |
from __future__ import print_function, unicode_literals
|
28 |
from __future__ import print_function, unicode_literals
|
29 |
|
29 |
|
30 |
import posixpath
|
30 |
import posixpath
|
31 |
import re
|
31 |
import re
|
32 |
import sys
|
32 |
import sys
|
|
|
33 |
PY3 = sys.version > '3'
|
33 |
import conftree
|
34 |
import conftree
|
34 |
|
35 |
|
35 |
default_mime = "audio/mpeg"
|
36 |
default_mime = "audio/mpeg"
|
36 |
default_samplerate = "44100"
|
37 |
default_samplerate = "44100"
|
37 |
|
38 |
|
|
... |
|
... |
184 |
username = altconf.get('u', servicename)
|
185 |
username = altconf.get('u', servicename)
|
185 |
password = altconf.get('p', servicename)
|
186 |
password = altconf.get('p', servicename)
|
186 |
return username, password
|
187 |
return username, password
|
187 |
|
188 |
|
188 |
def uplog(s):
|
189 |
def uplog(s):
|
189 |
if not type(s) == type(u''):
|
190 |
if not type(s) == type(b''):
|
190 |
s = s.decode('utf-8', errors='replace')
|
|
|
191 |
print(("%s: %s" % (_idprefix, s)).encode('utf-8',errors='replace'),
|
191 |
s = ("%s: %s" % (_idprefix, s)).encode('utf-8')
|
192 |
file=sys.stderr)
|
192 |
if PY3:
|
|
|
193 |
sys.stderr.buffer.write(s + b'\n')
|
|
|
194 |
else:
|
|
|
195 |
sys.stderr.write(s + b'\n')
|
|
|
196 |
sys.stderr.flush()
|