_rule.py 文件源码

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

项目:gprime 作者: GenealogyCollective 项目源码 文件源码
def requestprepare(self, dbase):
        """
        Request that the prepare method of the rule is executed if needed

        Special: Custom Filters have fixed values, so only one instance needs to
        exists during a search. It is stored in a FilterStore, and initialized
        once.
        As filters are can be grouped in a group
        filter, we request a prepare. Only the first time prepare will be
        called
        """
        if self.nrprepare == 0:
            if self.use_regex:
                self.regex = [None]*len(self.labels)
                for i in range(len(self.labels)):
                    if self.list[i]:
                        try:
                            self.regex[i] = re.compile(self.list[i], re.I)
                        except re.error:
                            self.regex[i] = re.compile('')
                self.match_substring = self.match_regex
            self.prepare(dbase)
        self.nrprepare += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号