schodet / nxt-python

NXT-Python is a python driver/interface for the Lego Mindstorms NXT robot based on NXT_python.
https://ni.srht.site/nxt-python/latest/
GNU General Public License v3.0
231 stars 72 forks source link

[Feature Request] Better config file #57

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The current config file is hard to understand. strict=0, usb=False, it's 
inconsistent. I had to dig through the source to figure out why my brick wasn't 
being recognized and ended up reimplementing it with the json module instead.

Why do you think it's important?
It's frustrating when things don't work. Also, it'll get rid of your eval call, 
which really isn't Pythonic at all.

Any ideas on how to implement it?
I used the json module. Renaming the existing keys would be a good approach as 
well.

Please provide any additional information below.
I've attached my config file. I might attach the modified locator.py when I 
finish cleaning it up.

Original issue reported on code.google.com by i.nnikishi on 9 Jul 2013 at 4:59

Attachments:

Bottersnike commented 8 years ago

If you want, @Eelviny, I have some code that I always use the parse config files that look like the following:

stuf: True morestuf: False startDate: 15432252 someNumber: 213 someWords: hello