def unregister_package(name): command_topics=find_help_topic_applies(lambda x: any((y for y in x if tools.get_package(commands[getRealCommand(y)]).lower()==name.lower())), apply_on=[list]) if not command_topics: return for topic in command_topics: for command in [i for i in topic if tools.get_package(commands[getRealCommand(i)]).lower()==name.lower()]: unregister_command(command)
def unregister_package(name): global extraHandlers for event in extraHandlers: needRemove=[] for func in extraHandlers[event]: if tools.get_package(func.__module__).lower()==name.lower(): needRemove+=[func] for func in needRemove: extraHandlers[event].remove(func)