summaryrefslogtreecommitdiff
path: root/modules/ships.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-09-01 00:27:54 +0200
committerBotond Hende <nettingman@gmail.com>2024-09-01 00:27:54 +0200
commite66fb136c8fd10fe8bafb273c938a3d332d997ba (patch)
tree94623092ecb1bb6177ecc7b922aeaec429cc08d3 /modules/ships.py
parent21019bc8414e60495573807b0fe0eb562a0e8876 (diff)
setting tasks for ships
Diffstat (limited to 'modules/ships.py')
-rw-r--r--modules/ships.py8
1 files changed, 4 insertions, 4 deletions
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()