def __merge_into_extractedmap(self, out_all_models, models): '''Add all in list models into out_all_models''' if out_all_models is None: out_all_models = {} for model in models: keytitle = model.shunked_title if keytitle not in out_all_models: out_all_models[keytitle] = [model] else: models = out_all_models[keytitle] models.append(model) return out_all_models
def __merge_into_extractedmap(self, out_all_models, models): '''Add all in list models into out_all_models''' if out_all_models is None : out_all_models = {} for model in models: keytitle = model.shunked_title if keytitle not in out_all_models: out_all_models[keytitle] = [model] else: models = out_all_models[keytitle] models.append(model) return out_all_models
def extract_from_source(self, page_html): blocks_html = None if page_html is not None and len(page_html) > 0: blocks_html = self._split(page_html) if (blocks_html is None or len(blocks_html) == 0): msg = ">" * 10 + "(block html is none)" + "<" * 10 print msg models = [] for block in blocks_html: model = self.__extract_googlescholar_result(block) if model is not None: models.append(model) return models
def extract_from_source(self, page_html): blocks_html = None if page_html is not None and len(page_html) > 0: blocks_html = self._split(page_html) if(blocks_html is None or len(blocks_html) == 0): msg = ">"*10 + "(block html is none)" + "<"*10 print msg models = [] for block in blocks_html: model = self.__extract_googlescholar_result(block) if model is not None: models.append(model) return models