def __init__(self, request): GraphDataBase.__init__(self, request) self.sock_path = os.path.join(request.cfg.data_dir, 'graphserver.sock') self.sock = socket(AF_UNIX, SOCK_STREAM) self.sock.connect(self.sock_path) if 1: self.conn_file = self.sock.makefile("r+") else: self.conn_file = os.fdopen(os.dup(self.sock), "r+", 1)
def __init__(self, request, dbname="gwiki", couchurl=None): log.debug("couchdb graphdb init") GraphDataBase.__init__(self, request) self.dbname = dbname if couchurl: self.couch_server = couchdb.Server(couchurl) else: self.couch_server = couchdb.Server() self.make_pagemeta_class() # we could really use db connection recycling/pooling... self.init_db() # use write cache/bulk update workaround for rehash slowness, # unsafe otherwise self.doing_rehash = False self.modified_pages = {}