Currently, the description of the keypress is inferred from the called function's docstring. This means that when functions are used for several different keystrokes, they get the same description. It also prohibits a function's docstring being descriptive and the keypress's description (as shown to the user) being short and succint.
We can decouple this by putting the description of the keypress in the options dictionary with the function to call in a tuple. For example:
We can also add description when building options dynamically:
self.options = {
str(i): (self.edit_score_confirm, s)
for i, s in enumerate(self.current_criterion.scores)
}
and so on.
The handling of the keypress and print help when pressing '?' will need to be updated to either get the function to execute (index=0 of the value) or get the help/description (index=1 of the value)
Currently, the description of the keypress is inferred from the called function's docstring. This means that when functions are used for several different keystrokes, they get the same description. It also prohibits a function's docstring being descriptive and the keypress's description (as shown to the user) being short and succint.
We can decouple this by putting the description of the keypress in the options dictionary with the function to call in a tuple. For example:
We can also add description when building options dynamically:
and so on.
The handling of the keypress and print help when pressing '?' will need to be updated to either get the function to execute (index=0 of the value) or get the help/description (index=1 of the value)