Exemple #1
0
class GraphBase(object):

    def __init__(self):
        self.conn = RexProConnection('localhost', 8184, 'graph')


    def execute_query(self, script, params=None):
        self.conn.open()
        r = self.conn.execute(script, params)
        self.conn.close()
        return r
Exemple #2
0
class Binary(_Request):

    def __init__(self, uri, graph, username=None, password=None, port=8184):
        from rexpro import RexProConnection

        super(Binary, self).__init__(uri, username, password)

        self.connection = RexProConnection(uri, port, graph)

    def send(self, script=None, params=None, update_models=None):
        if params is None:
            params = {}

        if update_models is None:
            update_models = {}

        self.connection.open()
        resp = self.connection.execute(script, params)
        self.connection.close()
        response = _Response(resp, update_models)
        response.script = script
        response.params = params

        return response