Exemplo n.º 1
0
    def __deepcopy__(self, memo):
        cl = self.__class__()

        attrs = utils.save_attrs(self, [
            a for a in self.__dict__
            if a not in ['query', 'hits', 'facets', 'db_fetch', 'cache']
        ])
        utils.load_attrs(cl, attrs)

        if self.db_fetch:
            cl.AttachDBFetch(self.db_fetch)

        if self.facets:
            facets = []
            for f in self.facets:
                attrs = utils.save_attrs(f, [
                    a for a in f.__dict__
                    if a not in ['_db', 'results', 'query']
                ])
                f = Facet(f.name)
                utils.load_attrs(f, attrs)
                facets.append(f)
            cl.AttachFacets(*facets)

        if self.cache:
            cl.AttachCache(self.cache)

        return cl
Exemplo n.º 2
0
 def __deepcopy__(self, memo):
     cl = self.__class__()
     attrs = utils.save_attrs(self,
         [a for a in self.__dict__ if a not in ['query_handler']])
     utils.load_attrs(cl, attrs)
     if self.query_handler:
         cl.query_handler = bsets.QueryHandler(self.query_handler.computed_index)
     return cl
Exemplo n.º 3
0
 def __deepcopy__(self, memo):
     cl = self.__class__()
     attrs = utils.save_attrs(
         self, [a for a in self.__dict__ if a not in ['query_handler']])
     utils.load_attrs(cl, attrs)
     if self.query_handler:
         cl.query_handler = bsets.QueryHandler(
             self.query_handler.computed_index)
     return cl
Exemplo n.º 4
0
    def __deepcopy__(self, memo):
        cl = self.__class__()

        attrs = utils.save_attrs(self,
            [a for a in self.__dict__ if a not in ['query', 'hits', 'facets', 'db_fetch', 'cache']])
        utils.load_attrs(cl, attrs)

        if self.db_fetch:
            cl.AttachDBFetch(self.db_fetch)

        if self.facets:
            facets = []
            for f in self.facets:
                attrs = utils.save_attrs(f,
                    [a for a in f.__dict__ if a not in ['_db', 'results', 'query']])
                f = Facet(f.name)
                utils.load_attrs(f, attrs)
                facets.append(f)
            cl.AttachFacets(*facets)

        if self.cache:
            cl.AttachCache(self.cache)

        return cl
Exemplo n.º 5
0
 def LoadSphinxOpts(opts):
     utils.load_attrs(cl, opts)
Exemplo n.º 6
0
 def LoadSphinxOpts(opts):
     utils.load_attrs(cl, opts)