Formatting
This commit is contained in:
@@ -26,6 +26,7 @@ def build_container_routing_labels(prefix: str, strip_prefix=True):
|
||||
|
||||
return labels
|
||||
|
||||
|
||||
def stop_container(docker_id):
|
||||
try:
|
||||
client = docker.from_env()
|
||||
@@ -53,7 +54,10 @@ def start_foundry_container(table: GameTable, key: KeyTable, version=12):
|
||||
image = "felddy/foundryvtt:{version}".format(version=version)
|
||||
labels = build_container_routing_labels(table.game_table_link, False)
|
||||
os.makedirs("/data/" + table.game_table_link + "/Config", exist_ok=True)
|
||||
shutil.copyfile(src="/data/keys/" + key.key_file, dst="/data/"+table.game_table_link+"/Config/license.json")
|
||||
shutil.copyfile(
|
||||
src="/data/keys/" + key.key_file,
|
||||
dst="/data/" + table.game_table_link + "/Config/license.json",
|
||||
)
|
||||
volumes = {
|
||||
"/home/cow/Projects/dockertesting/data/{prefix}".format(
|
||||
prefix=table.game_table_link
|
||||
|
||||
@@ -31,6 +31,7 @@ CREATE TABLE IF NOT EXISTS "game_keys" (
|
||||
);
|
||||
"""
|
||||
|
||||
|
||||
def init_db(connection):
|
||||
with SmartCursor(connection=connection) as smart_cursor:
|
||||
smart_cursor.execute(_game_table_create)
|
||||
|
||||
@@ -10,7 +10,12 @@ class KeyTable:
|
||||
updated: bool
|
||||
|
||||
def __init__(
|
||||
self, key: str, game_table_id: int, key_file: str, created: bool = True, updated: bool = True
|
||||
self,
|
||||
key: str,
|
||||
game_table_id: int,
|
||||
key_file: str,
|
||||
created: bool = True,
|
||||
updated: bool = True,
|
||||
):
|
||||
self.key = key
|
||||
self.game_table_id = game_table_id
|
||||
@@ -19,7 +24,11 @@ class KeyTable:
|
||||
self.updated = updated
|
||||
|
||||
def toJson(self):
|
||||
return {"key": self.key, "table_id": self.game_table_id, "key_file": self.key_file}
|
||||
return {
|
||||
"key": self.key,
|
||||
"table_id": self.game_table_id,
|
||||
"key_file": self.key_file,
|
||||
}
|
||||
|
||||
def reserve(self, game_table_id):
|
||||
self.game_table_id = game_table_id
|
||||
|
||||
Reference in New Issue
Block a user