View trac-tickets-to-gh.py
import sys; reload(sys); sys.setdefaultencoding('utf-8') | |
import MySQLdb | |
import urllib2 | |
import urllib | |
import simplejson | |
login = 'your github login' | |
token = 'your github API key' | |
repo = 'username/repo' |
View simulate_errorcodes.py
import web | |
import httplib | |
urls = ("/(.+?)/?", "http_err") | |
app = web.application(urls, globals()) | |
class http_err: | |
def GET(self, err_code): | |
err_code = int(err_code.split("/")[0]) | |
response = "%d %s" % (err_code, httplib.responses[err_code]) |