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: 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: class ParentPDB:
get = make_parent_action("get_parameter", "name", KeyError) get = make_parent_action("get_parameter", "key", KeyError)
set = make_parent_action("set_parameter", "name value") set = make_parent_action("set_parameter", "key value")
update_rt_results = make_parent_action("update_rt_results", "mod") update_rt_results = make_parent_action("update_rt_results", "mod")

View File

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