# Path: ravel/log.py
# LEVELS = { "debug" : logging.DEBUG,
#            "info" : logging.INFO,
#            "warning" : logging.WARNING,
#            "error" : logging.ERROR,
#            "critical" : logging.CRITICAL
#        }
# DEFAULT_LEVEL = logging.ERROR
# MSG_FORMAT = "%(levelname)s:%(funcName)s: %(message)s"
# class Singleton(type):
# class RavelLogger(Logger, object):
#     def __init__(cls, name, bases, dict_):
#     def __call__(cls, *args, **kw):
#     def __init__(self):
#     def setLogLevel(self, levelname=None):
# 
# Path: ravel/util.py
# def resource_file(name=None):
#     """Search for a file within the distribution and return its absolute path.
#        If no name is passed, returns the absolute path to the distribution's
#        top-level directory
#        name: the name of the file
#        returns: absolute path to the file"""
#     install_path = os.path.dirname(os.path.abspath(__file__))
#     install_path = os.path.normpath(
#         os.path.join(install_path, ".."))
# 
#     if name is None:
#         return install_path
# 
#     return os.path.abspath(os.path.join(install_path, name))


import psycopg2
from ravel.log import logger
from ravel.util import resource_file
"""
The Ravel backend PostgreSQL database
"""



ISOLEVEL = psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT

BASE_SQL = resource_file("ravel/sql/base.sql")
FLOW_SQL = resource_file("ravel/sql/flows.sql")
NOFLOW_SQL = resource_file("ravel/sql/noflows.sql")

# Path: ravel/log.py
# LEVELS = { "debug" : logging.DEBUG,
#            "info" : logging.INFO,
#            "warning" : logging.WARNING,
#            "error" : logging.ERROR,
#            "critical" : logging.CRITICAL
#        }
# DEFAULT_LEVEL = logging.ERROR
# MSG_FORMAT = "%(levelname)s:%(funcName)s: %(message)s"
# class Singleton(type):
# class RavelLogger(Logger, object):
#     def __init__(cls, name, bases, dict_):
#     def __call__(cls, *args, **kw):
#     def __init__(self):
#     def setLogLevel(self, levelname=None):
# 
# Path: ravel/util.py
# def resource_file(name=None):
#     """Search for a file within the distribution and return its absolute path.
#        If no name is passed, returns the absolute path to the distribution's
#        top-level directory
#        name: the name of the file
#        returns: absolute path to the file"""
#     install_path = os.path.dirname(os.path.abspath(__file__))
#     install_path = os.path.normpath(
#         os.path.join(install_path, ".."))
# 
#     if name is None:
#         return install_path
# 
#     return os.path.abspath(os.path.join(install_path, name))


# Path: ravel/db.py
import psycopg2
from ravel.log import logger
from ravel.util import resource_file

"""
The Ravel backend PostgreSQL database
"""



ISOLEVEL = psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT

BASE_SQL = resource_file("ravel/sql/base.sql")
FLOW_SQL = resource_file("ravel/sql/flows.sql")
NOFLOW_SQL = resource_file("ravel/sql/noflows.sql")

TOPO_SQL = resource_file("ravel/sql/topo.sql")