#!/usr/bin/env python
# -*- coding:utf-8 -*-

import ConfigParser 

# BaseHttp类
class BaseDatabaseConfig:
    '''配置数据库的相关信息'''

    def __init__(self, table_type, ini_file):
        config = ConfigParser.ConfigParser()

        #从配置文件中读取接口服务器IP、域名，端口
        config.read(ini_file)
        self.host = config.get(table_type,'host')
        self.port = config.get(table_type,'port')
        self.database = config.get(table_type,'database')
        self.username = config.get(table_type,'username')
        self.password = config.get(table_type,'password')
        self.table = config.get(table_type,'table')

    def get_host(self):
        return self.host

    def get_port(self):
        return  self.port

    def get_database(self):
        return self.database

    def get_username(self):
        return self.username

    def get_password(self):
        return self.password

    def get_table(self):
        return self.table