Mercurial > code > home > repos > homeauto
comparison service/arduinoNode/arduinoNode.py @ 214:254d656af72e
support a dir of config files
Ignore-this: 729d0aea065af5a0fac6b07653b1d3d2
author | drewp@bigasterisk.com |
---|---|
date | Sun, 03 Jan 2016 02:27:17 -0800 |
parents | 9c8674329a13 |
children | f8ffb9d8d982 |
comparison
equal
deleted
inserted
replaced
213:9c8674329a13 | 214:254d656af72e |
---|---|
38 | 38 |
39 class Config(object): | 39 class Config(object): |
40 def __init__(self): | 40 def __init__(self): |
41 self.graph = Graph() | 41 self.graph = Graph() |
42 log.info('read config') | 42 log.info('read config') |
43 self.graph.parse('config.n3', format='n3') | 43 for f in os.listdir('config'): |
44 if f.startswith('.'): continue | |
45 self.graph.parse('config/%s' % f, format='n3') | |
44 self.graph.bind('', ROOM) # not working | 46 self.graph.bind('', ROOM) # not working |
45 self.graph.bind('rdf', RDF) | 47 self.graph.bind('rdf', RDF) |
46 | 48 |
47 def serialDevices(self): | 49 def serialDevices(self): |
48 return dict([(row.dev, row.board) for row in self.graph.query( | 50 return dict([(row.dev, row.board) for row in self.graph.query( |