def __init__(self, rules_path=None):
        u"""
        :param rules_path: Путь до файла с правилами.
            В случае отсутствия будет взят путь по умолчанию,
            указанный в `DEFAULT_RULES_PATH`
        :return:
        """
        if rules_path is None:
            rules_path = DEFAULT_RULES_PATH

        if not os.path.exists(rules_path):
            raise IOError((
                'File with rules {} does not exists!'
            ).format(rules_path))

        try:
            with open(rules_path, 'r', encoding='utf8') as fp:
                self.data = json.load(fp)
        except:
            with open(rules_path, 'r') as fp:
                self.data = json.load(fp)
def __init__ ( self , rules_path = None ) : if rules_path is None : rules_path = DEFAULT_RULES_PATH if not os . path . exists ( rules_path ) : raise IOError ( ( 'File with rules {} does not exists!' ) . format ( rules_path ) ) try : with open ( rules_path , 'r' , encoding = 'utf8' ) as fp : self . data = json . load ( fp ) except : with open ( rules_path , 'r' ) as fp : self . data = json . load ( fp )
u"""
        :param rules_path: Путь до файла с правилами.
            В случае отсутствия будет взят путь по умолчанию,
            указанный в `DEFAULT_RULES_PATH`
        :return: