diff options
Diffstat (limited to 'lorrycontroller/statedb.py')
-rw-r--r-- | lorrycontroller/statedb.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lorrycontroller/statedb.py b/lorrycontroller/statedb.py index f1da8c9..b49da60 100644 --- a/lorrycontroller/statedb.py +++ b/lorrycontroller/statedb.py @@ -59,6 +59,7 @@ class StateDB(object): ('path', 'TEXT PRIMARY KEY'), ('text', 'TEXT'), ('from_trovehost', 'TEXT'), + ('from_path', 'TEXT'), ('running_job', 'INT'), ('kill_job', 'INT'), ('last_run', 'INT'), @@ -290,8 +291,8 @@ class StateDB(object): 'SELECT path FROM lorries WHERE from_trovehost IS ?', (trovehost,)) return [row[0] for row in c.fetchall()] - def add_to_lorries(self, path=None, text=None, from_trovehost=None, - interval=None): + def add_to_lorries(self, path=None, text=None, from_trovehost=None, + from_path=None, interval=None): logging.debug( 'StateDB.add_to_lorries(' 'path=%r, text=%r, from_trovehost=%r, interval=%s called', @@ -303,6 +304,7 @@ class StateDB(object): assert path is not None assert text is not None assert from_trovehost is not None + assert from_path is not None assert interval is not None assert self.in_transaction @@ -320,9 +322,9 @@ class StateDB(object): c = self.get_cursor() c.execute( 'UPDATE lorries ' - 'SET text=?, from_trovehost=?, interval=? ' + 'SET text=?, from_trovehost=?, from_path=?, interval=? ' 'WHERE path IS ?', - (text, from_trovehost, interval, path)) + (text, from_trovehost, from_path, interval, path)) def remove_lorry(self, path): logging.debug('StateDB.remove_lorry(%r) called', path) |