# Path: zaifbot/db/config.py
# def __db_path():
# def _get_engine(file_path):
#     def _create_engine():
# 
# Path: zaifbot/logger.py
# def _bot_console_handler():
# def _bot_file_handler(file=None):
# def _bot_logger():
# def _trade_logger():
# def add_logging_directions(webhook_url=None, email={}):


from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from sqlalchemy.exc import SQLAlchemyError
from zaifbot.db.config import Session
from zaifbot.logger import bot_logger
import numbers



class DaoBase(metaclass=ABCMeta):
    def __init__(self):
        self._Model = self._get_model()

    @staticmethod
    @contextmanager
    def _transaction():
        s = Session()
        try:
            yield s
            s.commit()
        except SQLAlchemyError as e:

# Path: zaifbot/db/config.py
# def __db_path():
# def _get_engine(file_path):
#     def _create_engine():
# 
# Path: zaifbot/logger.py
# def _bot_console_handler():
# def _bot_file_handler(file=None):
# def _bot_logger():
# def _trade_logger():
# def add_logging_directions(webhook_url=None, email={}):


# Path: zaifbot/db/dao/base.py
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from sqlalchemy.exc import SQLAlchemyError
from zaifbot.db.config import Session
from zaifbot.logger import bot_logger
import numbers




class DaoBase(metaclass=ABCMeta):
    def __init__(self):
        self._Model = self._get_model()

    @staticmethod
    @contextmanager
    def _transaction():
        s = Session()
        try:
            yield s
            s.commit()
        except SQLAlchemyError as e:

            bot_logger.exception(e)