Skip to content

Instantly share code, notes, and snippets.

View chengui's full-sized avatar

Gui Chen chengui

  • Intel
  • BeiJing, China
View GitHub Profile
#!/usr/bin/env python
"""Aliases for argparse positional arguments."""
import argparse
class AliasedSubParsersAction(argparse._SubParsersAction):
class _AliasedPseudoAction(argparse.Action):
def __init__(self, name, aliases, help):
# -*- coding: utf-8 -*-
"""
Python logging tuned to extreme.
"""
__author__ = "Mikko Ohtamaa <mikko@opensourcehacker.com>"
__license__ = "MIT"
@chengui
chengui / ansistrm.py
Created September 26, 2013 03:01 — forked from vsajip/ansistrm.py
#
# Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license.
#
import ctypes
import logging
import os
class ColorizingStreamHandler(logging.StreamHandler):
# color names to indices
color_map = {