Closed tararoys closed 2 years ago
this is fixed in the next (unreleased) beta
one thing I would say, is you should use the following pattern, which also doesn't have this problem:
for key, value in dict.items():
...
rather than:
for key in dict:
value = dict[key]
so write_context_commands would look like this:
def write_context_commands(file, commands):
# write out each command and it's implementation
for key, command in commands.items():
try:
rule = command.rule.rule
implementation = command.target.code.replace("\n","\n\t\t")
except Exception:
continue
file.write("\n - **" + rule + "** `" + implementation + "`\n")
as you're not even using the key
, you can also write this:
def write_context_commands(file, commands):
# write out each command and it's implementation
for command in commands.values():
try:
rule = command.rule.rule
implementation = command.target.code.replace("\n","\n\t\t")
except Exception:
continue
file.write("\n - **" + rule + "** `" + implementation + "`\n")
The following bug made the linked previously working cheat-sheet generation code stop working:
The workaround for this error is to change line 97 on the cheatsheet code from
to
https://gist.github.com/tararoys/345deec8188b4613e24222e7b0616ac3#file-cheatsheet-py-L97
Which seems like an awkward fix.
Slack discussion here:
https://talonvoice.slack.com/archives/C9MHQ4AGP/p1647818929183129