summaryrefslogtreecommitdiff
path: root/modules/ships.py
diff options
context:
space:
mode:
authorBotond Hende <nettingman@gmail.com>2024-09-01 23:33:15 +0200
committerBotond Hende <nettingman@gmail.com>2024-09-01 23:33:15 +0200
commita994b822a4231061153c6b27d8c5d7307b59f8b0 (patch)
tree0807c64b101c4f62d3795467e9da552536e5df87 /modules/ships.py
parentf55028d8d7d703f348190598d2fce93103070d17 (diff)
ship task setting from request body
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 e35cdd2..05ce6c1 100644
--- a/modules/ships.py
+++ b/modules/ships.py
@@ -1,6 +1,6 @@
from typing import Dict
-from . import task_type
+from . import task_types
from .database import cursor, conn
@@ -20,10 +20,10 @@ class Ship:
row = cursor.fetchone()
if row is None:
cursor.execute("INSERT INTO ships (symbol, task, params, name) VALUES (?, ?, ?, ?)",
- (self.symbol, task_type.IDLE, None, self.symbol))
+ (self.symbol, task_types.IDLE, None, self.symbol))
conn.commit()
- self.task = task_type.IDLE
+ self.task = task_types.IDLE
self.task = self.symbol
else:
self.name = row[0]
@@ -31,7 +31,7 @@ class Ship:
def set_task(self, task):
self.task = task
- if task != task_type.ERROR:
+ if task != task_types.ERROR:
cursor.execute("UPDATE ships SET task = ? WHERE symbol = ?", (task, self.symbol))
conn.commit()