From: Luke Kenneth Casson Leighton Date: Thu, 2 Aug 2018 06:17:22 +0000 (+0100) Subject: add comments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1b5d99a7317ad6b777699238881d9c976cf2b6c;p=pinmux.git add comments --- diff --git a/src/ifacebase.py b/src/ifacebase.py index cdbfc4d..e4a80ec 100644 --- a/src/ifacebase.py +++ b/src/ifacebase.py @@ -38,7 +38,6 @@ class InterfacesBase(UserDict): def __init__(self, ifacekls, pth=None, ifaceklsdict=None): self.pth = pth - self.fastbus = [] self.ifacecount = [] self.fastbus = [] if ifaceklsdict is None: @@ -52,12 +51,18 @@ class InterfacesBase(UserDict): ift = os.path.join(pth, ift) cfg = os.path.join(pth, cfg) + # read in configs in JSON format, but strip out unicode with open(cfg, 'r') as ifile: self.configs = json.loads(ifile.read(), object_hook=_decode_dict) - print self.configs + # process the configs, look for "bus" type... XXX TODO; make this + # a bit more sophisticated + self.fastbus = [] + for (ifacename, v) in self.configs.items(): + if v.get('bus', "") == "fastbus": + self.fastbus.append(ifacename) - exit(0) + # reads the interfaces, name and quantity of each with open(ift, 'r') as ifile: for ln in ifile.readlines(): ln = ln.strip()