# Path: girlfriend/exception.py
# class GirlFriendBizException(GirlFriendException):
# 
#     """业务相关的异常，属于意料之中的用户错误，捕获该异常之后可以按照正常的业务流程进行处理，
#        常用于面向最终用户的Facade层。最常见的场景就是在命令行工具中，可以捕获该异常，
#        向用户输出错误消息并退出或者重新输入参数，因为是正常的逻辑错误，无需上报Bug和输出错误日志。
#     """
#     pass


import os
import os.path
import StringIO
import requests
from ConfigParser import SafeConfigParser
from girlfriend.exception import GirlFriendBizException
    def __getattr__(self, key):
        if key not in self:
            raise AttributeError(u"属性 '{}' 不存在".format(key))
        return self[key]

    def __setattr__(self, key, value):
        self[key] = value

    def prefix(self, *pre):
        """根据Section前缀获取子配置项
        """
        return {section: self[section]
                for section in self if section.startswith(pre)}

    def get(self, section, item_name=None):
        if item_name is None:
            return dict.get(self, section)
        section_items = dict.get(self, section, {})
        if not section_items:
            return None
        return section_items.get(item_name)


class ConfigFileNotExistException(GirlFriendBizException):

    """当目标配置文件不存在时抛出此异常
    """
    pass



# Path: girlfriend/exception.py
# class GirlFriendBizException(GirlFriendException):
# 
#     """业务相关的异常，属于意料之中的用户错误，捕获该异常之后可以按照正常的业务流程进行处理，
#        常用于面向最终用户的Facade层。最常见的场景就是在命令行工具中，可以捕获该异常，
#        向用户输出错误消息并退出或者重新输入参数，因为是正常的逻辑错误，无需上报Bug和输出错误日志。
#     """
#     pass


# Path: girlfriend/util/config.py
import os
import os.path
import StringIO
import requests
from ConfigParser import SafeConfigParser
from girlfriend.exception import GirlFriendBizException

    def __getattr__(self, key):
        if key not in self:
            raise AttributeError(u"属性 '{}' 不存在".format(key))
        return self[key]

    def __setattr__(self, key, value):
        self[key] = value

    def prefix(self, *pre):
        """根据Section前缀获取子配置项
        """
        return {section: self[section]
                for section in self if section.startswith(pre)}

    def get(self, section, item_name=None):
        if item_name is None:
            return dict.get(self, section)
        section_items = dict.get(self, section, {})
        if not section_items:
            return None
        return section_items.get(item_name)


class ConfigFileNotExistException(GirlFriendBizException):

    """当目标配置文件不存在时抛出此异常
    """
    pass



class UnknownConfigResourceException(GirlFriendBizException):