Mercurial > code > home > repos > light9
diff bin/collector @ 1859:f066d6e874db
2to3 with these fixers: all idioms set_literal
Ignore-this: cbd28518218c2f0ddce8c4f92d3b8b33
author | drewp@bigasterisk.com |
---|---|
date | Wed, 22 May 2019 00:08:22 +0000 |
parents | 7772cc48e016 |
children | 5bcb950024af |
line wrap: on
line diff
--- a/bin/collector Tue May 21 23:56:12 2019 +0000 +++ b/bin/collector Wed May 22 00:08:22 2019 +0000 @@ -7,7 +7,7 @@ Input can be over http or zmq. """ -from __future__ import division + from run_local import log from rdflib import URIRef, Literal @@ -34,7 +34,7 @@ body = json.loads(msg) settings = [] for device, attr, value in body['settings']: - if isinstance(value, basestring) and value.startswith('http'): + if isinstance(value, str) and value.startswith('http'): value = URIRef(value) else: value = Literal(value) @@ -114,7 +114,7 @@ def makeMsg(self, dev, attrs, outputMap): attrRows = [] - for attr, val in attrs.items(): + for attr, val in list(attrs.items()): output, index = outputMap[(dev, attr)] attrRows.append({ 'attr': attr.rsplit('/')[-1],