storage2.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:InplusTrader_Linux 作者: zhengwsh 项目源码 文件源码
def __init__(self, config, api):
        """
        Constructor.

        parameters
        ----------
        * config: DBConfig object; specifies database configs.
        * api: PyApi object.

        """
        self._api = api # Set Datayes PyApi.
        if config.body:
            try:
                self._config = config.body
                self._client = config.body['client']
                self._dbs = config.body['dbs']
                self._dbNames = config.body['dbNames']
                self._connected = True
            except KeyError:
                msg = '[MONGOD]: Unable to configure database; ' + \
                      'config file is incomplete.'
                raise VNPAST_ConfigError(msg)
            except Exception,e:
                msg = '[MONGOD]: Unable to configure database; ' + str(e)
                raise VNPAST_ConfigError(msg)

        if self._connected:
            #self._get_coll_names()
            #self._ensure_index()
            pass

    #----------------------------------------------------------------------
    # Get collection names methods.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号