Mercurial > code > home > repos > homeauto
diff service/wifi/scrape.py @ 1225:b8c0daabe5a5
factor out some URI generation
Ignore-this: 3c982a1fdbadcc3154278fbae3d2ce0
darcs-hash:22be14eeb34ca3e87842f4619af6277851033561
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sat, 30 Mar 2019 18:59:19 -0700 |
parents | e1202af42d4d |
children | 7de8f0cd3392 |
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