Skip to content

Instantly share code, notes, and snippets.

"""click-style subcommand groups with clize"""
from sigtools import signature, signatures
from clize import run, parser, Parameter
def subcommand_parameter(func):
class param(parser.PositionalParameter):
def read_argument(self, ba, i):
value = self.get_value(ba, i)
@epsy
epsy / aagidgw.py
Created September 23, 2013 00:58
AAGID OpenID Gateway consumer example
from collections import MutableMapping
from openid.consumer import consumer, discover
from openid.store.filestore import FileOpenIDStore
from flask import request, redirect, session
class OidSessionWrapper(MutableMapping):
"""encodes and decodes python-openid-specific types to and from
json-serializable types"""
@epsy
epsy / gist:2815864
Created May 27, 2012 20:51
SethBling's MCEdit filter that turns chests into trading villagers
# Feel free to modify and use this filter however you wish. If you do,
# please give credit to SethBling.
# http://youtube.com/SethBling
from pymclevel import (
TAG_Compound, TAG_Int, TAG_Short, TAG_Byte, TAG_String, TAG_Float,
TAG_Double, TAG_List
)
def perform(level, box, options):