tmetsch / pytkgen

Create Tkinter GUIs from JSON definition files.
http://tmetsch.github.io/pytkgen/
GNU Lesser General Public License v3.0
120 stars 26 forks source link

Add Support for pyjson5 #9

Open rejogc opened 5 years ago

rejogc commented 5 years ago

Using pyjson5 instead of the standard json would greatly enhance the usefulness of this tool. It would also be only a 1 line change to the source code from 'import json' to 'import pyjson5 as json'. pyjson5 is a backwards compatible implementation of json following the proposed json5 standard and it's available in PyPI. json5 offers a lot of readability features that would make the json input into pytkgen.gengui look a lot more like a standard python dictionary. Also, json5 allows for single and double line comments. That would make pytkgen much more usable because one could then add comments to their gui code or comment out parts that don't work.

tmetsch commented 5 years ago

Hi,

thanks for that suggestion - I will look into json5. The commenting feature would be nice to have feature, for sure.

Maybe we could try to import pyjson5, and if not available fallback to the default json module. I'll do some test and see if I can find an elegant solution. If you have one, feel free to create a PR.

Thanks!

rejogc commented 5 years ago

Try/except on the import is probably the cleanest way to go.

BTW, thanks for pytkgen. Very simple and concise gui tool

On Sun, Jan 27, 2019, 6:57 AM tmetsch <notifications@github.com wrote:

Hi,

thanks for that suggestion - I will look into json5. The commenting feature would be nice to have feature, for sure.

Maybe we could try to import pyjson5, and if not available fallback to the default json module. I'll do some test and see if I can find an elegant solution. If you have one, feel free to create a PR.

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tmetsch/pytkgen/issues/9#issuecomment-457924709, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYglDOPwrpBAbd9y5eRL3AjgvMBlFBxks5vHb5mgaJpZM4aUc6n .