From e66fb136c8fd10fe8bafb273c938a3d332d997ba Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sun, 1 Sep 2024 00:27:54 +0200 Subject: setting tasks for ships --- modules/ships.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/ships.py') diff --git a/modules/ships.py b/modules/ships.py index 0a296ca..8dfe41a 100644 --- a/modules/ships.py +++ b/modules/ships.py @@ -1,4 +1,4 @@ -from . import tasks +from . import task_type from .database import cursor, conn @@ -13,15 +13,15 @@ class Ship: cursor.execute("SELECT task, params FROM ships WHERE symbol = ?", (self.symbol,)) row = cursor.fetchone() if row is None: - cursor.execute("INSERT INTO ships (symbol, task, params) VALUES (?, ?, ?)", (self.symbol, tasks.IDLE, None)) + cursor.execute("INSERT INTO ships (symbol, task, params) VALUES (?, ?, ?)", (self.symbol, task_type.IDLE, None)) conn.commit() - self.task = tasks.IDLE + self.task = task_type.IDLE else: self.task = row[0] def set_task(self, task): self.task = task - if task != tasks.ERROR: + if task != task_type.ERROR: cursor.execute("UPDATE ships SET task = ? WHERE symbol = ?", (task, self.symbol)) conn.commit() -- cgit v1.2.3-70-g09d2