summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-10-14 23:17:13 +0200
committerMichael Buesch <m@bues.ch>2013-10-14 23:17:13 +0200
commitf7a8f791ac9a85b3a64fe009dc1ddaef77e94bf2 (patch)
tree67e9ddf5014308aec13624eeaf708172cbf5ac2d
parent1f517231b7fccc50fb1f76dfa267b7975f293d24 (diff)
downloadtoprammer-f7a8f791ac9a85b3a64fe009dc1ddaef77e94bf2.tar.xz
toprammer-f7a8f791ac9a85b3a64fe009dc1ddaef77e94bf2.zip
makeSip6.py: Do not write init file.
Do this manually when adding a new type Signed-off-by: Michael Buesch <m@bues.ch>
-rwxr-xr-xlibtoprammer/chips/microchip8/makeSip6.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/libtoprammer/chips/microchip8/makeSip6.py b/libtoprammer/chips/microchip8/makeSip6.py
index 838be90..2f024fa 100755
--- a/libtoprammer/chips/microchip8/makeSip6.py
+++ b/libtoprammer/chips/microchip8/makeSip6.py
@@ -42,20 +42,18 @@ def substitute(input, oldSocket, newSocket):
def makeSip():
inputFileName = '__init__.py'
fin = open(inputFileName)
- # from pic16f1824dip14 import *
dMCU = {}
for line in fin:
- matchObj = re.match('#do not edit the text below this line.*', line)
+ matchObj = re.match('.*(pic[0-9]+l?f\w+)(sip[0-9a]+).*', line)
if matchObj:
- break
+ continue
matchObj = re.match('.*(pic[0-9]+l?f\w+)(dip[0-9a]+).*', line)
if not matchObj:
print("{} did not match".format(line))
continue
- print('matched {} - {}'.format(matchObj.group(1), matchObj.group(2)))
+# print('matched {} - {}'.format(matchObj.group(1), matchObj.group(2)))
dMCU.setdefault(matchObj.group(1), matchObj.group(2))
fin.close()
- finit = open("init", "a")
for item in dMCU.items():
fin = open("{}{}.py".format(item[0], item[1]))
fout = open("{}sip6.py".format(item[0]), 'w')
@@ -67,10 +65,7 @@ def makeSip():
fout.write(substitute(line, "{}".format(item[1]), "sip6"))
fout.close()
fin.close()
- finit.write("from {}sip6 import *\n".format(item[0]))
- finit.close()
- print ('{} - {}'.format(item[0], item[1]))
-
+
def main(argv):
makeSip()
bues.ch cgit interface