(self, expression, url)
Get search results from Docker Hub using v1 API
Get search results from Docker Hub using v1 API
Get search results from Docker Hub using v1 API
def search_get_page_v1(self, expression, url):
        """Get search results from Docker Hub using v1 API"""
        if expression:
            url = url + "/v1/search?q=%s" % expression
        else:
            url = url + "/v1/search?"
        url += "&page=%s" % str(self.search_page)
        (dummy, buf) = self._get_url(url)
        try:
            repo_list = json.loads(buf.getvalue())
            if repo_list["page"] == repo_list["num_pages"]:
                self.search_ended = True
            return repo_list
        except (IOError, OSError, AttributeError,
                ValueError, TypeError):
            self.search_ended = True
            return []
def search_get_page_v1 ( self , expression , url ) : if expression : url = url + "/v1/search?q=%s" % expression else : url = url + "/v1/search?" url += "&page=%s" % str ( self . search_page ) ( dummy , buf ) = self . _get_url ( url ) try : repo_list = json . loads ( buf . getvalue ( ) ) if repo_list [ "page" ] == repo_list [ "num_pages" ] : self . search_ended = True return repo_list except ( IOError , OSError , AttributeError , ValueError , TypeError ) : self . search_ended = True return [ ]