path are now in the path module

This commit is contained in:
Faraphel 2023-03-07 11:26:39 +01:00
parent 15b522cb7b
commit 15353991f6
20 changed files with 29 additions and 33 deletions

View file

@ -4,7 +4,7 @@ from source.gui.scene import MainMenu
from source.gui.window import GameWindow
from source import path_font
from source.path import path_font
from source.gui.better_pyglet import Label

View file

@ -1,12 +0,0 @@
from pathlib import Path
path_save: Path = Path("./.save")
path_save.mkdir(exist_ok=True)
path_history: Path = Path("./.history")
path_history.mkdir(exist_ok=True)
path_assets: Path = Path("./assets")
path_sound: Path = path_assets / "sound"
path_image: Path = path_assets / "image"
path_font: Path = path_assets / "font"

View file

@ -9,4 +9,3 @@ ipv4_check, ipv4_type = r"\d{1,3}(\.\d{1,3}){3}", r"[\d\.]{0,15}"
port_check, port_type = number(min_length=1, max_length=5), number(min_length=0, max_length=5)
username_check, username_type = r".{1,16}", r".{0,16}"

View file

@ -4,7 +4,7 @@ from datetime import datetime, timedelta
from pathlib import Path
from typing import TYPE_CHECKING, Optional
from source import path_save, path_history
from source.path import path_save, path_history
from source.core.enums import BombState
from source.core.error import InvalidBombPosition, PositionAlreadyShot
from source.gui.scene import GameResult

View file

@ -2,7 +2,7 @@ import math
from pathlib import Path
from typing import TYPE_CHECKING
from source import path_history
from source.path import path_history
from source.gui import widget, texture
from source.gui.scene.abc import Scene

View file

@ -1,6 +1,6 @@
from .type import Sound
from .abc import SoundGroup
from source import path_sound
from source.path import path_sound
path = path_sound / "game"

View file

@ -1,6 +1,6 @@
from .abc import Style
from source.gui.texture.type import Texture
from source import path_image
from source.path import path_image
path = path_image / "background"

View file

@ -1,6 +1,6 @@
from .abc import Style
from source.gui.texture.type import Texture
from source import path_image
from source.path import path_image
path = path_image / "button"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture
from source import path_image
from source.path import path_image
path = path_image / "checkbox"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture, Animation
from source import path_image
from source.path import path_image
path = path_image / "grid"
path_boat = path / "boat"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture
from source import path_image
from source.path import path_image
path = path_image / "input"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture
from source import path_image
from source.path import path_image
path = path_image / "popup"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture
from source import path_image
from source.path import path_image
path = path_image / "replay"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Animation
from source import path_image
from source.path import path_image
path = path_image / "result"

View file

@ -1,6 +1,6 @@
from .abc import Style
from .type import Texture
from source import path_image
from source.path import path_image
path = path_image / "scroller"

View file

@ -1,7 +1,5 @@
from typing import TYPE_CHECKING, Callable, Any, Type
import pyglet.image
from source.gui.better_pyglet import Sprite, Label
from source.gui.texture.abc import Style
from source.gui.widget.abc import BoxWidget

View file

@ -3,8 +3,6 @@ from typing import TYPE_CHECKING
from source.gui.better_pyglet import Label
from source.gui.widget.abc import BoxWidget
import pyglet
from source.type import Distance
if TYPE_CHECKING:

View file

@ -1,9 +1,9 @@
import json
import socket
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, Callable
from typing import TYPE_CHECKING, Optional, Callable
from source import path_save
from source.path import path_save
from source.gui import scene
from source.network import game_network
from source.network.packet import PacketUsername, PacketSettings, PacketHaveSaveBeenFound, PacketLoadOldSave

View file

@ -4,7 +4,7 @@ from pathlib import Path
from typing import TYPE_CHECKING, Optional
from threading import Condition
from source import path_save
from source.path import path_save
from source.gui import scene
from source.network import game_network
from source.utils import StoppableThread

13
source/path.py Normal file
View file

@ -0,0 +1,13 @@
from pathlib import Path
path_save: Path = Path("./.save")
path_save.mkdir(exist_ok=True)
path_history: Path = Path("./.history")
path_history.mkdir(exist_ok=True)
path_assets: Path = Path("./assets")
path_sound: Path = path_assets / "sound"
path_image: Path = path_assets / "image"
path_font: Path = path_assets / "font"