import logging
import functools
import pandas as pd
import numpy as np
from importer import utility
from .exceptions import DataImportError

logger = logging.getLogger('Excel XML processor')
utility.setup_logger(logger)


class SubmissionData:
    '''
    Logic dealing with the submission (load etc)
    '''
    def __init__(self, metaData):
        self.MetaData = metaData
        self.DataTables = None
        self.DataTableIndex = None

    def load_sheet(self, reader, sheetname):
        df = None
        try:
            df = reader.parse(sheetname)
        except:  # pylint: disable=bare-except
            pass
        logger.info('SHEET %s: %s', sheetname,
                    'READ' if df is not None else 'NOT FOUND')
        return df

    def load(self, source):
    def __init__(self, db_opts):
        utility.setup_logger(logger)

        self.db_opts = db_opts
        self.connection = None