Exemplo n.º 1
0
Arquivo: graph.py Projeto: xoltar/atk
def initialize_graph(graph, graph_info):
    """Initializes a graph according to given graph_info"""
    graph._id = graph_info.id_number
    graph._name = graph_info.name
    graph._ia_uri = graph_info.ia_uri
    graph._uri = server.create_full_uri("graphs/" + str(graph._id))
    return graph
Exemplo n.º 2
0
Arquivo: graph.py Projeto: xoltar/atk
def initialize_graph(graph, graph_info):
    """Initializes a graph according to given graph_info"""
    graph._id = graph_info.id_number
    graph._name = graph_info.name
    graph._ia_uri = graph_info.ia_uri
    graph._uri= server.create_full_uri("graphs/"+ str(graph._id))
    return graph
Exemplo n.º 3
0
def default_repr(self, collection_name):
    """Default __repr__ for a synthesized class"""
    entity = type(self).__name__
    try:
        from trustedanalytics.rest.atkserver import server
        uri = server.create_full_uri(self.uri)
        response = server.get(uri).json()
        name = response.get('name', None)
        if name:
            details = ' "%s"' % response['name']
        else:
            details = ' <unnamed@%s>' % response['uri']
    except:
        raise
        #details = " (Unable to collect details from server)"
    return entity + details
Exemplo n.º 4
0
def default_repr(self, collection_name):
    """Default __repr__ for a synthesized class"""
    entity = type(self).__name__
    try:
        from trustedanalytics.rest.atkserver import server
        uri = server.create_full_uri(collection_name + "/" + str(self._id))
        response = server.get(uri).json()
        name = response.get('name', None)
        if name:
            details = ' "%s"' % response['name']
        else:
            details = ' <unnamed@%s>' % response['id']
    except:
        raise
        #details = " (Unable to collect details from server)"
    return entity + details
Exemplo n.º 5
0
 def _get_model_full_uri(self):
     return server.create_full_uri(self.uri)
Exemplo n.º 6
0
Arquivo: model.py Projeto: xoltar/atk
 def _get_model_full_uri(self):
     return server.create_full_uri('models/%d' % self._id)