Skip to content

Instantly share code, notes, and snippets.

@prophile
Created November 21, 2013 01:23
Show Gist options
  • Select an option

  • Save prophile/7574441 to your computer and use it in GitHub Desktop.

Select an option

Save prophile/7574441 to your computer and use it in GitHub Desktop.
formats = {}
formats['vanilla'] = {'player_join': '(?P<name>[A-Za-z0-9_]{1,16}) has joined the game\.'}
formats['bukkit'] = {'plugin_loading': '\[(?P<plugin_name>.+\] plugin loaded\.'}
formats['ping_1.6'] = {...}
# Select which combinations to use, taking right-to-left precedence
options = ['ping_1.6', 'vanilla']
messages = dict(itertools.chain.from_iterable(formats[x].items() for x in options))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment