示例#1
0
 def load(self, lookup_collection):
     YLogger.debug(self, "Loading lookup from Mongo [%s]",
                   self.collection_name())
     collection = self.collection()
     lookups = collection.find()
     if lookups is not None:
         for lookup in lookups:
             key, value = DoubleStringPatternSplitCollection.process_key_value(
                 lookup['key'], lookup['value'])
             lookup_collection.add_to_lookup(key, value)
示例#2
0
    def load(self, collector, name=None):
        YLogger.debug(self, "Loading lookup from Mongo [%s]",
                      self.collection_name())
        collection = self.collection()
        lookups = collection.find()
        for lookup in lookups:
            key, value = DoubleStringPatternSplitCollection.process_key_value(
                lookup['key'], lookup['value'])
            collector.add_to_lookup(key, value)

        return True
示例#3
0
 def load(self, collector, name=None):
     db_lookups = self._get_all()
     for db_lookup in db_lookups:
         key, value = DoubleStringPatternSplitCollection.process_key_value(
             db_lookup.key, db_lookup.value)
         collector.add_to_lookup(key, value)
示例#4
0
 def process_key_value(self, key, value, id=None):
     return DoubleStringPatternSplitCollection.process_key_value(
         key, value, id)