Closed sebastientinel closed 5 years ago
I confirm the issue is due to the use of python2.
Here is a test by changing the use of ConfigParser object following Python 2 doc (opposed to Python 3 doc) :
c = configparser.ConfigParser()
c.read(os.path.join(os.path.abspath(os.path.dirname(__file__)),
'../frontend/conf',
'settings.ini'))
# Python 2
test = c.get('nest', 'nest_index')
print(test)
# Python 3
test2 = c['nest']['nest_index']
print(test2)
Here is the result :
[root@lab backend]# python test.py
0
Traceback (most recent call last):
File "test.py", line 32, in <module>
test2 = c['nest']['nest_index']
AttributeError: ConfigParser instance has no attribute '__getitem__'
So is the code supposed to run in Python 3 ? If it is the case, nest.py need to be converted for Python 3.
Thank you for you feedback/help. If needed I can provide some help.
I haven't time (and Nest Thermostat) to maintain this project. Feel free to open a PR to fix it :)
Thanks.
Hi,
I used to run an old version of Nest Datagraph (thank you very much by the way) without configparser. I just did a clone of the repository (in a new directory) in order to update my installation.
When I tried to run poller.py, I've got issue bellow :
It seems it could be due to a syntax issue regarding python2 and python3. Indeed, the syntax used in poller.py seems to be intended to run with python3. Altough, nest.py is developed to use python2.
Maybe something is wrong in my environment.
Please find bellow the details of my environment :
Thank you for your help/inputs