comparison sat/plugins/plugin_misc_android.py @ 3057:f91d0e6d9b13

plugin android: fixed encoding in states after Python 3 port
author Goffi <goffi@goffi.org>
date Wed, 16 Oct 2019 08:39:52 +0200
parents ab2696e34d29
children fb49587f55c2
comparison
equal deleted inserted replaced
3056:49c7bc3afb2b 3057:f91d0e6d9b13
61 PARAM_VIBRATE_CATEGORY = "Notifications" 61 PARAM_VIBRATE_CATEGORY = "Notifications"
62 PARAM_VIBRATE_NAME = "vibrate" 62 PARAM_VIBRATE_NAME = "vibrate"
63 PARAM_VIBRATE_LABEL = D_("Vibrate on notifications") 63 PARAM_VIBRATE_LABEL = D_("Vibrate on notifications")
64 SOCKET_DIR = "/data/data/org.salutatoi.cagou/" 64 SOCKET_DIR = "/data/data/org.salutatoi.cagou/"
65 SOCKET_FILE = ".socket" 65 SOCKET_FILE = ".socket"
66 STATE_RUNNING = "running" 66 STATE_RUNNING = b"running"
67 STATE_PAUSED = "paused" 67 STATE_PAUSED = b"paused"
68 STATE_STOPPED = "stopped" 68 STATE_STOPPED = b"stopped"
69 STATES = (STATE_RUNNING, STATE_PAUSED, STATE_STOPPED) 69 STATES = (STATE_RUNNING, STATE_PAUSED, STATE_STOPPED)
70 NET_TYPE_NONE = "no network" 70 NET_TYPE_NONE = "no network"
71 NET_TYPE_WIFI = "wifi" 71 NET_TYPE_WIFI = "wifi"
72 NET_TYPE_MOBILE = "mobile" 72 NET_TYPE_MOBILE = "mobile"
73 NET_TYPE_OTHER = "other" 73 NET_TYPE_OTHER = "other"
196 def state(self): 196 def state(self):
197 return self._state 197 return self._state
198 198
199 @state.setter 199 @state.setter
200 def state(self, new_state): 200 def state(self, new_state):
201 log.debug("frontend state has changed: {state}".format(state=new_state)) 201 log.debug(f"frontend state has changed: {new_state.decode()}")
202 previous_state = self._state 202 previous_state = self._state
203 self._state = new_state 203 self._state = new_state
204 if new_state == STATE_RUNNING: 204 if new_state == STATE_RUNNING:
205 self._onRunning(previous_state) 205 self._onRunning(previous_state)
206 elif new_state == STATE_PAUSED: 206 elif new_state == STATE_PAUSED: