On Thursday, 4 April 2019 09:31:11 UTC-3, Thomas Keffer wrote:
>
> The problem here is that the record itself was not in the database.
>
I see it different.
The value in the database is None because no loop value was received when
the record was written.
The value for rr is None.
The exception says: TypeError: 'NoneType' object has no attribute
'__getitem__'
Thus: rr[0] throws an error.
Solution [not tested]:
try:
rr = dbmanager.getSql('select rainRate from %s where
dateTime=?' %
dbmanager.table_name, (r['dateTime'],))
except weedb.OperationalError:
pass
else:
if rr is not None:
r['rainRate'] = rr[0]
else:
r['rainRate'] = None
return r
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.