convert to python3
[pinmux.git] / src / spec / base.py
index a03ad93f6bbcb773b7ed081d7445b784cb069c32..dc2cf0c8b23ab1578fcabead77db6b608c49fed6 100644 (file)
@@ -1,7 +1,7 @@
 from spec.interfaces import Pinouts
 
 from spec.ifaceprint import display, display_fns, check_functions
-from spec.ifaceprint import display_fixed
+from spec.ifaceprint import display_fixed, python_dict_fns
 from collections import OrderedDict
 
 
@@ -18,7 +18,7 @@ class PinSpec(Pinouts):
         bankspec = OrderedDict()
         self.offs = 0
         pkeys = self.pinbanks.keys()
-        print self.pinbanks
+        print (self.pinbanks)
         for kn in pkeys:
             bankspec[kn] = self.offs
             self.offs += self.pinbanks[kn]
@@ -37,7 +37,11 @@ class PinSpec(Pinouts):
 
         self.scenarios.append((name, needed, eint, pwm, descriptions))
 
+    def pywrite(self, pyf, pinmap):
+        return python_dict_fns(pyf, pinmap, self, self.function_names)
+
     def write(self, of):
+
         of.write("""# Pinouts (PinMux)
 auto-generated by [[pinouts.py]]
 
@@ -72,6 +76,7 @@ auto-generated by [[pinouts.py]]
         of.write("""# Reference Datasheets
 
 datasheets and pinout links
+
 * <http://datasheets.chipdb.org/AMD/8018x/80186/amd-80186.pdf>
 * <http://hands.com/~lkcl/eoma/shenzen/frida/FRD144A2701.pdf>
 * <http://pinouts.ru/Memory/sdcard_pinout.shtml>