c26f8827854295228a774c928b307224ad128e2d,lib/streamlit/proxy/ClientWebSocket.py,ClientWebSocket,on_message,#ClientWebSocket#Any#,88

Before Change


    def on_message(self, msg):
        LOGGER.debug(f"Received message of length {len(msg)}.")
        backend_msg = protobuf.BackMsg()
        try:
            backend_msg.ParseFromString(payload)
            command  = backend_msg.command
            if command == protobuf.BackMsg.Command.Value("HELP"):
                os.system("python -m streamlit help &")
            elif command == protobuf.BackMsg.Command.Value("CLOUD_UPLOAD"):
                LOGGER.debug("CLOUD_UPLOAD!!!")
                yield self._save_cloud(connection, ws)
            else:
                LOGGER.warning("no handler for %s",
                    protobuf.BackMsg.Command.Name(backend_msg.command))
        except Exception as e:
            LOGGER.error("Cannot parse binary message: %s", e)

    @Proxy.stop_proxy_on_exception()
    def on_close(self):
        LOGGER.debug("Received close message.")
        self._is_open = False

After Change


    def on_message(self, msg):
        Run callback for websocket messages.
        LOGGER.debug(repr(msg))
        yield self._handle_backend_msg(msg, self._connection, self)

    @gen.coroutine
    def _handle_backend_msg(self, payload, connection, ws):
        backend_msg = protobuf.BackMsg()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: streamlit/streamlit
Commit Name: c26f8827854295228a774c928b307224ad128e2d
Time: 2018-06-18
Author: armando@playground.global
File Name: lib/streamlit/proxy/ClientWebSocket.py
Class Name: ClientWebSocket
Method Name: on_message


Project Name: streamlit/streamlit
Commit Name: 63630d4b66a0c8bdaa8ac924a3eb4755419e2b6c
Time: 2018-08-07
Author: adrien.g.treuille@gmail.com
File Name: lib/streamlit/__init__.py
Class Name:
Method Name: spinner


Project Name: streamlit/streamlit
Commit Name: 428de4b8d7ef06fe6970ab86e2c7c01b900ba9b5
Time: 2018-08-16
Author: adrien.g.treuille@gmail.com
File Name: lib/streamlit/__init__.py
Class Name:
Method Name: spinner