path are now in the path module
This commit is contained in:
parent
15b522cb7b
commit
15353991f6
20 changed files with 29 additions and 33 deletions
2
main.pyw
2
main.pyw
|
@ -4,7 +4,7 @@ from source.gui.scene import MainMenu
|
||||||
from source.gui.window import GameWindow
|
from source.gui.window import GameWindow
|
||||||
|
|
||||||
|
|
||||||
from source import path_font
|
from source.path import path_font
|
||||||
from source.gui.better_pyglet import Label
|
from source.gui.better_pyglet import Label
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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"
|
|
|
@ -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)
|
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}"
|
username_check, username_type = r".{1,16}", r".{0,16}"
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ from datetime import datetime, timedelta
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Optional
|
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.enums import BombState
|
||||||
from source.core.error import InvalidBombPosition, PositionAlreadyShot
|
from source.core.error import InvalidBombPosition, PositionAlreadyShot
|
||||||
from source.gui.scene import GameResult
|
from source.gui.scene import GameResult
|
||||||
|
|
|
@ -2,7 +2,7 @@ import math
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
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 import widget, texture
|
||||||
from source.gui.scene.abc import Scene
|
from source.gui.scene.abc import Scene
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .type import Sound
|
from .type import Sound
|
||||||
from .abc import SoundGroup
|
from .abc import SoundGroup
|
||||||
from source import path_sound
|
from source.path import path_sound
|
||||||
|
|
||||||
path = path_sound / "game"
|
path = path_sound / "game"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from source.gui.texture.type import Texture
|
from source.gui.texture.type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "background"
|
path = path_image / "background"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from source.gui.texture.type import Texture
|
from source.gui.texture.type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "button"
|
path = path_image / "button"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture
|
from .type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "checkbox"
|
path = path_image / "checkbox"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture, Animation
|
from .type import Texture, Animation
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "grid"
|
path = path_image / "grid"
|
||||||
path_boat = path / "boat"
|
path_boat = path / "boat"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture
|
from .type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "input"
|
path = path_image / "input"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture
|
from .type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "popup"
|
path = path_image / "popup"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture
|
from .type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "replay"
|
path = path_image / "replay"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Animation
|
from .type import Animation
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "result"
|
path = path_image / "result"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .abc import Style
|
from .abc import Style
|
||||||
from .type import Texture
|
from .type import Texture
|
||||||
from source import path_image
|
from source.path import path_image
|
||||||
|
|
||||||
path = path_image / "scroller"
|
path = path_image / "scroller"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
from typing import TYPE_CHECKING, Callable, Any, Type
|
from typing import TYPE_CHECKING, Callable, Any, Type
|
||||||
|
|
||||||
import pyglet.image
|
|
||||||
|
|
||||||
from source.gui.better_pyglet import Sprite, Label
|
from source.gui.better_pyglet import Sprite, Label
|
||||||
from source.gui.texture.abc import Style
|
from source.gui.texture.abc import Style
|
||||||
from source.gui.widget.abc import BoxWidget
|
from source.gui.widget.abc import BoxWidget
|
||||||
|
|
|
@ -3,8 +3,6 @@ from typing import TYPE_CHECKING
|
||||||
from source.gui.better_pyglet import Label
|
from source.gui.better_pyglet import Label
|
||||||
from source.gui.widget.abc import BoxWidget
|
from source.gui.widget.abc import BoxWidget
|
||||||
|
|
||||||
import pyglet
|
|
||||||
|
|
||||||
from source.type import Distance
|
from source.type import Distance
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import json
|
import json
|
||||||
import socket
|
import socket
|
||||||
from pathlib import Path
|
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.gui import scene
|
||||||
from source.network import game_network
|
from source.network import game_network
|
||||||
from source.network.packet import PacketUsername, PacketSettings, PacketHaveSaveBeenFound, PacketLoadOldSave
|
from source.network.packet import PacketUsername, PacketSettings, PacketHaveSaveBeenFound, PacketLoadOldSave
|
||||||
|
|
|
@ -4,7 +4,7 @@ from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Optional
|
from typing import TYPE_CHECKING, Optional
|
||||||
from threading import Condition
|
from threading import Condition
|
||||||
|
|
||||||
from source import path_save
|
from source.path import path_save
|
||||||
from source.gui import scene
|
from source.gui import scene
|
||||||
from source.network import game_network
|
from source.network import game_network
|
||||||
from source.utils import StoppableThread
|
from source.utils import StoppableThread
|
||||||
|
|
13
source/path.py
Normal file
13
source/path.py
Normal 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"
|
Loading…
Reference in a new issue