TypeError: expected string or buffer
It looks like utils.py passes text that does not have a declared type to re.search, which can cause an error "TypeError: expected string or buffer". This can be corrected by changing lines 122,130, and 138 as follows:
res = re.search('(?<=\[).(?=\])', text) to res = re.search('(?<=\[).(?=\])', str(text))
res = re.search('(?<=\[\[).(?=\]\])', text) to res = re.search('(?<=\[\[).(?=\]\])', str(text))
res = re.search('(?<=\[\<).+(?=\>\])', text) to res = re.search('(?<=\[\<).+(?=\>\])', str(text))
Can you explain your case for this? If you pass something that is not a string into a hotkey, the TypeError should be expected, in my opinion. I'm not seeing the benefit of trying to convert the type.
One problem that could occur by doing this is if someone unintentionally passes in an object that will be converted to something like "<class '__main__.MyClassName'>" and could potentially make debugging harder for someone.
It would probably be more useful to the user if an error were thrown... The error is descriptive enough for someone to immediately recognize the problem and they can pass in str(choice_arg) themselves if that's the desired behavior.