Created
December 29, 2013 18:15
-
-
Save tetrapus/8173064 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query = sql.execute("SELECT DISTINCT name, prefix FROM commands ORDER BY name") | |
commands = {} | |
for key, value in query.fetchall(): | |
if key in commands: | |
commands[key] += [value] | |
else: | |
commands[key] = [value] | |
commands = ["".join("\x03%.2d%s" % ([14, 12][i % 2], p) for i, p in enumerate(sorted(v))) + "\x0f" + k for k, v in sorted(commands.items())] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment