diff 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
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_android.py	Wed Oct 16 08:39:35 2019 +0200
+++ b/sat/plugins/plugin_misc_android.py	Wed Oct 16 08:39:52 2019 +0200
@@ -63,9 +63,9 @@
 PARAM_VIBRATE_LABEL = D_("Vibrate on notifications")
 SOCKET_DIR = "/data/data/org.salutatoi.cagou/"
 SOCKET_FILE = ".socket"
-STATE_RUNNING = "running"
-STATE_PAUSED = "paused"
-STATE_STOPPED = "stopped"
+STATE_RUNNING = b"running"
+STATE_PAUSED = b"paused"
+STATE_STOPPED = b"stopped"
 STATES = (STATE_RUNNING, STATE_PAUSED, STATE_STOPPED)
 NET_TYPE_NONE = "no network"
 NET_TYPE_WIFI = "wifi"
@@ -198,7 +198,7 @@
 
     @state.setter
     def state(self, new_state):
-        log.debug("frontend state has changed: {state}".format(state=new_state))
+        log.debug(f"frontend state has changed: {new_state.decode()}")
         previous_state = self._state
         self._state = new_state
         if new_state == STATE_RUNNING: