mysqlparser.py 文件源码

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

项目:mysqlparser 作者: privacyidea 项目源码 文件源码
def _read_config(self):
        """
        This initializes `_key_map` and _children.
        """
        self._key_map = {}
        self._children = []
        root_dct = self.root.get_dict()
        base_directory = os.path.dirname(self.root.file)
        for section, contents in root_dct.iteritems():
            # find all !includedir lines, add configuration to self._children and self._sectionmap
            if section.startswith('!includedir'):
                relative_directory = section.split(' ', 1)[1]
                directory = os.path.abspath(os.path.join(base_directory, relative_directory))
                # include all files in the directory
                for filename in iglob(os.path.join(directory, '*.cnf')):
                    # order is not guaranteed, according to mysql docs
                    # parse every file, return parsing result
                    self._read_child_config(filename)
            elif section.startswith('!'):
                raise NotImplementedError()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号