Mercurial > code > home > repos > homeauto
diff service/wifi/scrape.py @ 422:19460b3f7baf
factor out some URI generation
Ignore-this: 3c982a1fdbadcc3154278fbae3d2ce0
author | drewp@bigasterisk.com |
---|---|
date | Sat, 30 Mar 2019 18:59:19 -0700 |
parents | 47d7dd31bb2c |
children | e0703c7824e9 |
line wrap: on
line diff
--- a/service/wifi/scrape.py Sat Mar 30 18:27:17 2019 -0700 +++ b/service/wifi/scrape.py Sat Mar 30 18:59:19 2019 -0700 @@ -5,9 +5,8 @@ log = logging.getLogger() -class Router(object): - def __repr__(self): - return repr(self.__dict__) +def macUri(macAddress: str) -> URIRef: + return URIRef("http://bigasterisk.com/mac/%s" % dev['mac'].lower()) class Wifi(object): """ @@ -63,7 +62,7 @@ for row in rows: if 'clientHostname' in row: row['name'] = row['clientHostname'] - mac = URIRef('http://bigasterisk.com/mac/%s' % row['mac'].lower()) + mac = macUri(row['mac'].lower()) label = self.graph.value(mac, RDFS.label) if label: row['name'] = label