korakot / kora

Convenient tools for Colab
MIT License
269 stars 38 forks source link

Update line.py #3

Closed thanakijwanavit closed 3 years ago

thanakijwanavit commented 3 years ago

just adding a debug option and returning raw line callback,

websocket.debug_mode() will activate the debug mode

thanakijwanavit commented 3 years ago

The solution to debug is not elegant yet.

I prefer just to change self.reply to have optional event argument, and set it to return json.dump of that argument.

To debug, just set self.reply = self.debug

I agree, it was a convoluted way to debug. I saved the event object to self instead of passing it around. What do you think about it?

korakot commented 3 years ago

self.event is a nice solution. Thanks!