Esempio n. 1
0
class RingoManager(NoSqlManager):
    def __init__(self, namespace, url=None, data_dir=None, lock_dir=None, **params):
        NoSqlManager.__init__(self, namespace, url=url, data_dir=data_dir, lock_dir=lock_dir, **params)

    def open_connection(self, host, port):
        self.domain = 'default'
        self.db_conn = Ringo("%s:%s" % (host, port))

    def __contains__(self, key):
        raise Exception("Unimplemented")

    def __getitem__(self, key):
        return pickle.loads(self.db_conn.get(self.domain, self._format_key(key)))

    def set_value(self, key, value):
        self.db_conn.put(self.domain, self._format_key(key), pickle.dumps(value))

    def __delitem__(self, key):
        raise Exception("Unimplemented")

    def do_remove(self):
        raise Exception("Unimplemented")

    def keys(self):
        raise Exception("Unimplemented")
Esempio n. 2
0
class RingoManager(NoSqlManager):
    def __init__(self, namespace, url=None, data_dir=None, lock_dir=None, **params):
        NoSqlManager.__init__(self, namespace, url=url, data_dir=data_dir, lock_dir=lock_dir, **params)

    def open_connection(self, host, port):
        self.domain = 'default'
        self.db_conn = Ringo("%s:%s" % (host, port))

    def __contains__(self, key):
        raise Exception("Unimplemented")

    def __getitem__(self, key):
        return pickle.loads(self.db_conn.get(self.domain, self._format_key(key)))

    def set_value(self, key, value):
        self.db_conn.put(self.domain, self._format_key(key), pickle.dumps(value))

    def __delitem__(self, key):
        raise Exception("Unimplemented")

    def do_remove(self):
        raise Exception("Unimplemented")

    def keys(self):
        raise Exception("Unimplemented")
Esempio n. 3
0
 def open_connection(self, host, port):
     self.domain = 'default'
     self.db_conn = Ringo("%s:%s" % (host, port))
Esempio n. 4
0
 def open_connection(self, host, port):
     self.domain = 'default'
     self.db_conn = Ringo("%s:%s" % (host, port))