diff --git a/tfscript.py b/tfscript.py index a033cac..715dee1 100644 --- a/tfscript.py +++ b/tfscript.py @@ -1,5 +1,6 @@ """ Makes the configs as a massive string """ +# Used for the conditions in the type condDict = {} def makeCFG(cfg): @@ -13,8 +14,8 @@ def makeCFG(cfg): # Doubles are weird. All of the toggles got put into a dictionary. # This takes all of the nested dictionaries and turns them into the right string for key, toggles in condDict.items(): - ret += f'alias +{key}_toggles \"{toggles["plus_toggles"]}\"\n' +\ - f'alias -{key}_toggles \"{toggles["minus_toggles"]}\"\n' +\ + ret += f'alias +{key}_toggles "{toggles["plus_toggles"]}"\n' +\ + f'alias -{key}_toggles "{toggles["minus_toggles"]}"\n' +\ f'bind {key} +{key}_toggles\n' return ret @@ -70,7 +71,7 @@ def impulse(key, instruction): elif cmd == "build" or cmd == "destroy": instruction = f"{cmd} "+expandBuildings(restOfCmd) - return f'bind {key} {instruction}\n' + return f'bind {key} "{instruction}"\n' def voice(keyword): keyword = keyword.lower() @@ -136,8 +137,8 @@ def double(key, options): ret = branch(main_str, pBindContent, pBindType) +\ branch(alt_str, sBindContent, sBindType) +\ - f'alias +{tog_str} \"bind {key} {alt_str}\"\n' +\ - f'alias -{tog_str} \"bind {key} {main_str}\"\n' + f'alias +{tog_str} "bind {key} {alt_str}"\n' +\ + f'alias -{tog_str} "bind {key} {main_str}"\n' cond_name = options["condition"]