Added minimal outputting to files

pull/11/head
Nicholas Hope 2022-06-16 18:31:46 -04:00
parent 88c93ae18d
commit 3a86e10c0b
1 changed files with 25 additions and 0 deletions

25
tfscript.py Normal file
View File

@ -0,0 +1,25 @@
""" Makes the configs as a massive string """
def makeCFG(cfg):
ret = ''
for key, data in cfg.items():
# I know all of these fields exist because it was verified in verify.py
bindType = firstTypeIn(data.keys())
bindContent = data[bindType]
ret += branch(key, bindType, bindContent)
return ret
def firstTypeIn(inputList):
""" Find the first element common to both lists """
types = [
"impulse",
"hold",
"toggle",
"double"
]
for e in types:
if e in inputList:
return e
def branch(keyName, bindType, bindContent):
return f'placeholder for {keyName}\n'