Skip to content

Instantly share code, notes, and snippets.

View swrichards's full-sized avatar

Sidney Richards swrichards

View GitHub Profile
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
"""\
See `StreamLogger`.
"""
import sys
import logging
import cStringIO
class StreamLogger(object):
from flask import Flask, request, make_response
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
from thrift.transport import TTransport
from FooService import FooService
from foo_service_handler import FooServiceHandler