pathmann / pyTSon

pyTSon is a plugin for the TeamSpeak 3 client, it offers a python interface for the plugin sdk
https://pytson.4qt.de
GNU General Public License v3.0
79 stars 12 forks source link

Call stop() method of console autorun script on close #106

Closed Bluscream closed 6 years ago

Bluscream commented 6 years ago

It would be neat if before closing the pytson console stop() will be called if it exists

pathmann commented 6 years ago

That's not the intention of the autorun feature. It's meant to do imports etc, not start long running tasks or such.

Simply calling a method if it exists does not feel clean. You can connect to signals of the console window.

Bluscream commented 6 years ago

Do i have to find the widget in .AllWidgets() or does the autorunscript provide it?

pathmann commented 6 years ago

The file is simply read in and evaluated: https://github.com/pathmann/pyTSon/blob/master/ressources/python/pytsonui/console.py#L87

The cleanest solution would be, if the context locals would be "destroyed" when the console is closed.

pathmann commented 6 years ago

3af3f64 will remove locals created in the console.