Switch to unified view

a/rdpl2stream/lib/common.py b/rdpl2stream/lib/common.py
1
# -*- coding: utf-8 -*-
1
from __future__ import print_function
2
import sys
2
3
3
APPVERSION="0.14"
4
APPVERSION="0.14"
5
4
# user-agent
6
# user-agent
5
try:
7
try:
6
  import platform
8
    import platform
7
  USER_AGENT = "%s/%s (%s %s; %s/%s (%s))" % ("Upmpdcli", APPVERSION, platform.system(), platform.machine(),
9
    USER_AGENT = "%s/%s (%s %s; %s/%s (%s))" % (
10
            "Upmpdcli", APPVERSION, platform.system(), platform.machine(),
8
                                              platform.linux_distribution()[0], platform.linux_distribution()[1],
11
            platform.linux_distribution()[0], platform.linux_distribution()[1],
9
                                              platform.linux_distribution()[2])
12
            platform.linux_distribution()[2])
10
except:
13
except:
11
  USER_AGENT = "Upmpdcli/" + APPVERSION
14
    USER_AGENT = "Upmpdcli/" + APPVERSION
15
16
17
class Logger:
18
    def mprint(self, m):
19
        #print("%s"%m, file=sys.stderr)
20
        pass
21
    def error(self, m):
22
        self.mprint(m)
23
    def warn(self, m):
24
        self.mprint(m)
25
    def info(self, m):
26
        self.mprint(m)
27
    def debug(self, m):
28
        self.mprint(m)