diff --git a/core/main_db.py b/core/main_db.py index c782e763..74b5cdef 100644 --- a/core/main_db.py +++ b/core/main_db.py @@ -169,10 +169,13 @@ class DBConnection(object): def upsert(self, table_name, value_dict, key_dict): + def gen_params(my_dict): + return [ + "{key} = ?".format(key=k) + for k in my_dict.keys() + ] + changes_before = self.connection.total_changes - - gen_params = lambda my_dict: ["{key} = ?".format(key=k) for k in my_dict.keys()] - items = list(value_dict.values()) + list(key_dict.values()) self.action( "UPDATE {table} " diff --git a/libs/custom/synchronousdeluge/client.py b/libs/custom/synchronousdeluge/client.py index bc82f8d6..3c07f572 100644 --- a/libs/custom/synchronousdeluge/client.py +++ b/libs/custom/synchronousdeluge/client.py @@ -79,11 +79,13 @@ class DelugeClient(object): return func def _introspect(self): + def splitter(value): + return value.split(".") + self.modules = [] methods = self.remote_call("daemon.get_method_list").get() methodmap = defaultdict(dict) - splitter = lambda v: v.split(".") for module, method in imap(splitter, methods): methodmap[module][method] = self._create_module_method(module, method)