sregistry/main/google_drive/query.py
def search_all(self):
    '''a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom properties value type set to
       container, which is set when the image is pushed. 

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the properties value with type
       as container. It also should have a "uri" in properties to show the 
       user, otherwise the user will have to query / download based on the id
    '''
 
    results = self._list_containers()
    matches = []

    bot.info("[drive://%s] Containers" %self._base)

    rows = []
    for i in results:

        # Fallback to the image name without the extension
        uri = i['name'].replace('.simg','')

        # However the properties should include the uri
        if 'properties' in i:
            if 'uri' in i['properties']:
                uri = i['properties']['uri']
        rows.append([i['id'],uri])

        # Give the user back a uri
        i['uri'] = uri
        matches.append(i)

    bot.custom(prefix="   [drive://%s]" %self._base, 
               message="\t\t[id]\t[uri]", 
               color="PURPLE")

    bot.table(rows)
    return matches
def search_all(self):
    '''a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom properties value type set to
       container, which is set when the image is pushed. 

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the properties value with type
       as container. It also should have a "uri" in properties to show the 
       user, otherwise the user will have to query / download based on the id
    '''
 
    results = self._list_containers()
    matches = []

    bot.info("[drive://%s] Containers" %self._base)

    rows = []
    for i in results:

        # Fallback to the image name without the extension
        uri = i['name'].replace('.simg','')

        # However the properties should include the uri
        if 'properties' in i:
            if 'uri' in i['properties']:
                uri = i['properties']['uri']
        rows.append([i['id'],uri])

        # Give the user back a uri
        i['uri'] = uri
        matches.append(i)

    bot.custom(prefix="   [drive://%s]" %self._base, 
               message="\t\t[id]\t[uri]", 
               color="PURPLE")

    bot.table(rows)
    return matches
a "list all" search that doesn't require a query. Here we return to
       the user all objects that have custom properties value type set to
       container, which is set when the image is pushed. 

       IMPORTANT: the upload function adds this metadata. For a container to
       be found by the client, it must have the properties value with type
       as container. It also should have a "uri" in properties to show the 
       user, otherwise the user will have to query / download based on the id