def _basic_search(self, terms): term = ''.join(terms) def __build_rows(username, auth): if username not in self._request_cache: repos = githubutils.get_all(username, auth, "repos") self._request_cache[username] = repos repos = self._request_cache[username] matches = [r for r in repos if term in r['full_name']] rows = [r['full_name'] + ":" + r['owner']['gravatar_id'] for r in matches] return rows if not term in self._search_cache: username, password = auth = githubutils.load_auth() # Not configured.. creds must not be in the keyring. if not username: os.system(config_tool) return [] rows = __build_rows(username, auth) for org in githubutils.get_all(username, auth, "orgs"): rows += __build_rows(org['login'], auth) self._search_cache[term] = rows return self._search_cache[term]
def _basic_search(self, terms): term = ''.join(terms) def __build_rows(username, auth): if username not in self._request_cache: repos = githubutils.get_all(username, auth, "repos") self._request_cache[username] = repos repos = self._request_cache[username] matches = [r for r in repos if term in r['full_name']] rows = [ r['full_name'] + ":" + r['owner']['gravatar_id'] for r in matches ] return rows if not term in self._search_cache: username, password = auth = githubutils.load_auth() # Not configured.. creds must not be in the keyring. if not username: os.system(config_tool) return [] rows = __build_rows(username, auth) for org in githubutils.get_all(username, auth, "orgs"): rows += __build_rows(org['login'], auth) self._search_cache[term] = rows return self._search_cache[term]
def __build_rows(username, auth): if username not in self._request_cache: repos = githubutils.get_all(username, auth, "repos") self._request_cache[username] = repos repos = self._request_cache[username] matches = [r for r in repos if term in r['full_name']] rows = [r['full_name'] + ":" + r['owner']['gravatar_id'] for r in matches] return rows
def __build_rows(username, auth): if username not in self._request_cache: repos = githubutils.get_all(username, auth, "repos") self._request_cache[username] = repos repos = self._request_cache[username] matches = [r for r in repos if term in r['full_name']] rows = [ r['full_name'] + ":" + r['owner']['gravatar_id'] for r in matches ] return rows