# Path: hecatoncheir/logger.py
# def to_unicode(s):
# def str2unicode(s):
# def setup():
# def ts():
# def trace(msg):
# def debug(msg):
# def info(msg):
# def info_cont(msg):
# def info_end(msg):
# def warning(msg):
# def error(msg, detail=None, query=None):
# def dump_datetime_default(o):
# def dump(msg, obj):
# 
# Path: hecatoncheir/exception.py
# class DriverError(Exception):
#     source = None
# 
#     def __init__(self, value, source=None):
#         self.value = value
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# class QueryError(Exception):
#     source = None
#     query = None
# 
#     def __init__(self, value, query, source=None):
#         self.value = value
#         self.query = query
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


from hecatoncheir import logger as log
from hecatoncheir.exception import (DriverError, QueryError, ValidationError)
from hecatoncheir.msgutil import gettext as _
        return eval(s)
    except SyntaxError as e:
        raise ValidationError(
            _("Syntax error: ") + "`%s'" % s,
            rule=p, params=kv)


class SQLValidator():
    """Base class of SQLValidator
    """
    label = None
    rule = None
    queryresult = None

    def __init__(self, label, rule):
        """Constructor

        Args:
            label (str): label
            rule (list): [column_name(s), query, expr]
        """
        assert isinstance(rule, list)

        self.label = label
        self.rule = rule
        self.column_names = rule[0].replace(' ', '').split(',')
        self.query = rule[1]

    def validate(self, dbdriver):
        if dbdriver is None:

# Path: hecatoncheir/logger.py
# def to_unicode(s):
# def str2unicode(s):
# def setup():
# def ts():
# def trace(msg):
# def debug(msg):
# def info(msg):
# def info_cont(msg):
# def info_end(msg):
# def warning(msg):
# def error(msg, detail=None, query=None):
# def dump_datetime_default(o):
# def dump(msg, obj):
# 
# Path: hecatoncheir/exception.py
# class DriverError(Exception):
#     source = None
# 
#     def __init__(self, value, source=None):
#         self.value = value
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# class QueryError(Exception):
#     source = None
#     query = None
# 
#     def __init__(self, value, query, source=None):
#         self.value = value
#         self.query = query
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


# Path: hecatoncheir/validator/SQLValidator.py
from hecatoncheir import logger as log
from hecatoncheir.exception import (DriverError, QueryError, ValidationError)
from hecatoncheir.msgutil import gettext as _

        return eval(s)
    except SyntaxError as e:
        raise ValidationError(
            _("Syntax error: ") + "`%s'" % s,
            rule=p, params=kv)


class SQLValidator():
    """Base class of SQLValidator
    """
    label = None
    rule = None
    queryresult = None

    def __init__(self, label, rule):
        """Constructor

        Args:
            label (str): label
            rule (list): [column_name(s), query, expr]
        """
        assert isinstance(rule, list)

        self.label = label
        self.rule = rule
        self.column_names = rule[0].replace(' ', '').split(',')
        self.query = rule[1]

    def validate(self, dbdriver):
        if dbdriver is None:

            raise DriverError(