def tree( path, indent = 0 ): raw = _OW.get( path ) if raw: entries = raw.split( ',' ) for entry in entries: print ' ' * indent, entry if entry[ -1 ] == '/': tree( entry, indent + 4 )
def tree(path, indent=0): raw = _OW.get(path) if raw: entries = raw.split(',') for entry in entries: print ' ' * indent, entry if entry[-1] == '/': tree(entry, indent + 4)
def _get(path): """ Get the sensor data. In the case where a sensor is disconnected from the bus or something else goes wrong, raise exUnknownSensor. """ sensor = _OW.get(path) if sensor == None: raise exUnknownSensor(path) return sensor
def log_get( path ): """ Write the _OW.get call details out to the log file. """ logfile.write( "_OW.get( '%s' )%s" % ( path, os.linesep ) ) return _OW.get(path)