# Path: radarpost/config.py
# CONFIG_INI_PARSER_PLUGIN = 'radarpost.config.configiniparser'
# 
# def parse_bool(b):
#     if isinstance(b, bool): 
#         return b
#     if isinstance(b, int): 
#         return b != 0
#     elif isinstance(b, basestring): 
#         if b.lower() == 'true': 
#             return True
#         elif b.lower() == 'false': 
#             return False        
#     raise ValueError('Cannot parse "%s" as a boolean (True or False)' % b)
# 
# def config_section(section, config, reprefix=''):
#     if not section.endswith('.'):
#         section = section + '.'
#     section_options = {}
#     for k in config.keys():
#         if k.startswith(section): 
#             section_options[reprefix + k[len(section):]] = config[k]
#     return section_options
# 
# Path: radarpost/plugins.py
# ENTRY_POINT = 'radarpost_plugins'
# def get(slot):
# def _get(slot):
# def register(thing, slot):
# def plugin(slot):
#     def dd(thing):
# def _search():


from httplib2 import Http as UnrestrictedHttp
from tinfoilhat import Http as RestrictedHttp
from radarpost.config import CONFIG_INI_PARSER_PLUGIN, parse_bool, config_section
from radarpost import plugins

def create_client(cfg):
    """
    create an http client according to 
    the configuration given.
    """


# Path: radarpost/config.py
# CONFIG_INI_PARSER_PLUGIN = 'radarpost.config.configiniparser'
# 
# def parse_bool(b):
#     if isinstance(b, bool): 
#         return b
#     if isinstance(b, int): 
#         return b != 0
#     elif isinstance(b, basestring): 
#         if b.lower() == 'true': 
#             return True
#         elif b.lower() == 'false': 
#             return False        
#     raise ValueError('Cannot parse "%s" as a boolean (True or False)' % b)
# 
# def config_section(section, config, reprefix=''):
#     if not section.endswith('.'):
#         section = section + '.'
#     section_options = {}
#     for k in config.keys():
#         if k.startswith(section): 
#             section_options[reprefix + k[len(section):]] = config[k]
#     return section_options
# 
# Path: radarpost/plugins.py
# ENTRY_POINT = 'radarpost_plugins'
# def get(slot):
# def _get(slot):
# def register(thing, slot):
# def plugin(slot):
#     def dd(thing):
# def _search():


# Path: radarpost/http.py
from httplib2 import Http as UnrestrictedHttp
from tinfoilhat import Http as RestrictedHttp
from radarpost.config import CONFIG_INI_PARSER_PLUGIN, parse_bool, config_section
from radarpost import plugins


def create_client(cfg):
    """
    create an http client according to 
    the configuration given.
    """


    cfg = config_section('http', cfg)