diff options
author | drebs <drebs@leap.se> | 2013-02-12 19:32:06 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-12 19:32:06 -0200 |
commit | 0133b65a287d007382d96bdc15b83068e681e4ef (patch) | |
tree | e9b19b38ab493f57b8ecd6cac00469b279dc275b /backends | |
parent | b848bfa450c1882f65d01b2adc57b9c8263539bd (diff) |
Small refactor (name change).
Diffstat (limited to 'backends')
-rw-r--r-- | backends/couch.py | 6 | ||||
-rw-r--r-- | backends/objectstore.py | 20 |
2 files changed, 13 insertions, 13 deletions
diff --git a/backends/couch.py b/backends/couch.py index d349efaf..30fd449c 100644 --- a/backends/couch.py +++ b/backends/couch.py @@ -139,7 +139,7 @@ class CouchDatabase(ObjectStore): index.add_json(doc_id, doc.get_json()) self._indexes[index_name] = index # save data in object store - self._set_u1db_data() + self._store_u1db_data() def close(self): # TODO: fix this method so the connection is properly closed and @@ -171,7 +171,7 @@ class CouchDatabase(ObjectStore): 'replica_uid': self._replica_uid} self._put_doc(doc) - def _get_u1db_data(self): + def _fetch_u1db_data(self): # retrieve u1db data from couch db cdoc = self._database.get(self.U1DB_DATA_DOC_ID) jsonstr = self._database.get_attachment(cdoc, 'u1db_json').getvalue() @@ -187,7 +187,7 @@ class CouchDatabase(ObjectStore): # save couch _rev self._couch_rev = cdoc['_rev'] - def _set_u1db_data(self): + def _store_u1db_data(self): doc = self._factory(doc_id=self.U1DB_DATA_DOC_ID) doc.content = { 'transaction_log': self._transaction_log, diff --git a/backends/objectstore.py b/backends/objectstore.py index 199107af..d7aa3049 100644 --- a/backends/objectstore.py +++ b/backends/objectstore.py @@ -17,7 +17,7 @@ class ObjectStore(InMemoryDatabase): # sync data in memory with data in object store if not self._get_doc(self.U1DB_DATA_DOC_ID): self._init_u1db_data() - self._get_u1db_data() + self._fetch_u1db_data() #------------------------------------------------------------------------- # methods from Database @@ -25,7 +25,7 @@ class ObjectStore(InMemoryDatabase): def _set_replica_uid(self, replica_uid): super(ObjectStore, self)._set_replica_uid(replica_uid) - self._set_u1db_data() + self._store_u1db_data() def _put_doc(self, doc): raise NotImplementedError(self._put_doc) @@ -59,11 +59,11 @@ class ObjectStore(InMemoryDatabase): def delete_index(self, index_name): super(ObjectStore, self).delete_index(index_name) - self._set_u1db_data() + self._store_u1db_data() def _replace_conflicts(self, doc, conflicts): super(ObjectStore, self)._replace_conflicts(doc, conflicts) - self._set_u1db_data() + self._store_u1db_data() def _do_set_replica_gen_and_trans_id(self, other_replica_uid, other_generation, @@ -72,7 +72,7 @@ class ObjectStore(InMemoryDatabase): other_replica_uid, other_generation, other_transaction_id) - self._set_u1db_data() + self._store_u1db_data() #------------------------------------------------------------------------- # implemented methods from CommonBackend @@ -87,7 +87,7 @@ class ObjectStore(InMemoryDatabase): trans_id = self._allocate_transaction_id() self._put_doc(doc) self._transaction_log.append((doc.doc_id, trans_id)) - self._set_u1db_data() + self._store_u1db_data() #------------------------------------------------------------------------- # methods specific for object stores @@ -95,17 +95,17 @@ class ObjectStore(InMemoryDatabase): U1DB_DATA_DOC_ID = 'u1db_data' - def _get_u1db_data(self): + def _fetch_u1db_data(self): """ Fetch u1db configuration data from backend storage. """ - NotImplementedError(self._get_u1db_data) + NotImplementedError(self._fetch_u1db_data) - def _set_u1db_data(self): + def _store_u1db_data(self): """ Save u1db configuration data on backend storage. """ - NotImplementedError(self._set_u1db_data) + NotImplementedError(self._store_u1db_data) def _init_u1db_data(self): """ |