def __init__(self, BLOB_HOSTER_URI, BLOB_HOSTER_USER, BLOB_HOSTER_PSWD, MDCS_URI=None): BLOBHoster.__init__(self, BLOB_HOSTER_URI, BLOB_HOSTER_USER, BLOB_HOSTER_PSWD) self.client = MongoClient(self.BLOB_HOSTER_URI) self.db = self.client[MGI_DB] self.fs = gridfs.GridFS(self.db) if MDCS_URI is not None: if len(MDCS_URI) > 0: if MDCS_URI[-1] != '/': MDCS_URI = MDCS_URI + '/' self.uri = MDCS_URI else: raise ValueError('MDCS_URI is empty.') else: raise ValueError('MDCS_URI is not set.')
def query(self, query): BLOBHoster.query(self)
def delete(self, handle): BLOBHoster.delete(self)
def save(self, blob, filename=None): BLOBHoster.save(self)
def list(self): BLOBHoster.list(self)
def get(self, handle): BLOBHoster.get(self)
def __init__(self, BLOB_HOSTER_URI, BLOB_HOSTER_USER, BLOB_HOSTER_PSWD): BLOBHoster.__init__(self, BLOB_HOSTER_URI, BLOB_HOSTER_USER, BLOB_HOSTER_PSWD)