From 512bc794843625a6aa5b85ff894918b57330bd85 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 4 Oct 2015 18:27:44 +0800 Subject: [PATCH] master: consistent db function argument names --- artiq/master/worker_impl.py | 7 ++++--- artiq/protocols/file_db.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index f8ff39746..b029e37d8 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -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") diff --git a/artiq/protocols/file_db.py b/artiq/protocols/file_db.py index 744eff687..089763cc1 100644 --- a/artiq/protocols/file_db.py +++ b/artiq/protocols/file_db.py @@ -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)