From: Luke Kenneth Casson Leighton Date: Sat, 21 Jul 2018 03:38:38 +0000 (+0100) Subject: pep8 cleanup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69f5494bd213dc2de0525e0f924cc958bdb1325d;p=pinmux.git pep8 cleanup --- diff --git a/src/bsv/peripheral_gen.py b/src/bsv/peripheral_gen.py index 82d8db6..b2352bd 100644 --- a/src/bsv/peripheral_gen.py +++ b/src/bsv/peripheral_gen.py @@ -51,7 +51,7 @@ class PBase(object): typ = p['type'] pname = p['name'] #n = "{0}{1}".format(self.name, self.mksuffix(name, count)) - n = name#"{0}{1}".format(self.name, self.mksuffix(name, count)) + n = name # "{0}{1}".format(self.name, self.mksuffix(name, count)) ret.append(" //%s %s" % (n, str(p))) sname = self.peripheral.pname(pname).format(count) ps = "pinmux.peripheral_side.%s" % sname @@ -80,7 +80,9 @@ class PBase(object): ps_ = ps + '_in' else: ps_ = ps - ret.append(" rule con_%s%d_%s_in" % (name, count, pname)) + ret.append( + " rule con_%s%d_%s_in" % + (name, count, pname)) ret.append(" {1}.{2}({0});".format(ps_, n, fname)) ret.append(" endrule") return '\n'.join(ret) @@ -95,9 +97,9 @@ class PBase(object): return i def __mk_connection(self, con, aname): - txt = " mkConnection (slow_fabric.v_to_slaves\n" + \ - " [fromInteger(valueOf({1}))],\n" + \ - " {0});" + txt = " mkConnection (slow_fabric.v_to_slaves\n" + \ + " [fromInteger(valueOf({1}))],\n" + \ + " {0});" print "PBase __mk_connection", self.name, aname if not con: @@ -129,6 +131,7 @@ class PBase(object): def pinname_tweak(self, pname, typ, txt): return txt + class uart(PBase): def slowimport(self): @@ -287,7 +290,7 @@ class gpio(PBase): def mkslow_peripheral(self): return " MUX#(%(name)s) mux{0} <- mkmux();\n" + \ " GPIO#(%(name)s) gpio{0} <- mkgpio();" % \ - {'name': self.name} + {'name': self.name} def mk_connection(self, count): print "GPIO mk_conn", self.name, count @@ -506,15 +509,16 @@ class PeripheralInterfaces(object): ret.append(txt) return '\n'.join(list(filter(None, ret))) + class PFactory(object): def getcls(self, name): for k, v in {'uart': uart, - 'rs232': rs232, - 'twi': twi, - 'qspi': qspi, - 'pwm': pwm, - 'gpio': gpio - }.items(): + 'rs232': rs232, + 'twi': twi, + 'qspi': qspi, + 'pwm': pwm, + 'gpio': gpio + }.items(): if name.startswith(k): return v return None diff --git a/src/ifacebase.py b/src/ifacebase.py index 3a3bf1d..0d6d250 100644 --- a/src/ifacebase.py +++ b/src/ifacebase.py @@ -47,7 +47,7 @@ class InterfacesBase(UserDict): # finds the interface type, e.g sd_d0 returns "inout" for iface in self.values(): typ = iface.getifacetype(fname) - #if fname.startswith('pwm'): + # if fname.startswith('pwm'): # print fname, iface.ifacename, typ if typ: return typ