def search_names(self, name): """Search by package name/glob. Return dict of dict[packagename] = [tag1, tag2, tag3, tag4, ...]""" res = {} (name, esc) = sql_esc(name) query = "SELECT name, tag, score FROM packagetags where name like ?%s " % esc name = '%' + name + '%' rows = self._sql_exec(query, (name, )) for (name, tag, score) in rows: if name not in res: res[name] = [] res[name].append(tag) return res
def search_names(self, name): """Search by package name/glob. Return dict of dict[packagename] = [tag1, tag2, tag3, tag4, ...]""" res = {} (name, esc) = sql_esc(name) query = "SELECT name, tag, score FROM packagetags where name like ?%s " % esc name = '%' + name + '%' rows = self._sql_exec(query, (name,)) for (name, tag, score) in rows: if name not in res: res[name] = [] res[name].append(tag) return res
def search_tags(self, tag): """Search by tag name/glob Return dict of dict[packagename] = [stringmatched, stringmatched, ...]""" res = {} (tag, esc) = sql_esc(tag) query = "SELECT name, tag, score FROM packagetags where tag like ? %s" % esc tag = '%' + tag + '%' rows = self._sql_exec(query, (tag, )) for (name, tag, score) in rows: if name not in res: res[name] = [] res[name].append(tag) return res
def search_tags(self, tag): """Search by tag name/glob Return dict of dict[packagename] = [stringmatched, stringmatched, ...]""" res = {} (tag, esc) = sql_esc(tag) query = "SELECT name, tag, score FROM packagetags where tag like ? %s" % esc tag = '%' + tag + '%' rows = self._sql_exec(query, (tag,)) for (name, tag, score) in rows: if name not in res: res[name] = [] res[name].append(tag) return res