forked from M-Labs/artiq
1
0
Fork 0

master: consistent db function argument names

This commit is contained in:
Sebastien Bourdeauducq 2015-10-04 18:27:44 +08:00
parent 168af9589e
commit 512bc79484
2 changed files with 12 additions and 11 deletions

View File

@ -63,12 +63,13 @@ class LogForwarder:
class ParentDDB:
get = make_parent_action("get_device", "name", KeyError)
get_ddb = make_parent_action("get_ddb", "")
get = make_parent_action("get_device", "key", KeyError)
class ParentPDB:
get = make_parent_action("get_parameter", "name", KeyError)
set = make_parent_action("set_parameter", "name value")
get = make_parent_action("get_parameter", "key", KeyError)
set = make_parent_action("set_parameter", "key value")
update_rt_results = make_parent_action("update_rt_results", "mod")

View File

@ -13,19 +13,19 @@ class FlatFileDB:
def save(self):
pyon.store_file(self.filename, self.data.read)
def get(self, name):
return self.data.read[name]
def get(self, key):
return self.data.read[key]
def set(self, name, value):
self.data[name] = value
def set(self, key, value):
self.data[key] = value
self.save()
timestamp = time()
for hook in self.hooks:
hook.set(timestamp, name, value)
hook.set(timestamp, key, value)
def delete(self, name):
del self.data[name]
def delete(self, key):
del self.data[key]
self.save()
timestamp = time()
for hook in self.hooks:
hook.delete(timestamp, name)
hook.delete(timestamp, key)