From 53ddf3c3b92def3af616146767dce9b91ad8b101 Mon Sep 17 00:00:00 2001 From: Flavio Calva Date: Mon, 6 Jun 2022 19:30:23 +0100 Subject: [PATCH] renamed lib to ya2 --- game/app.py | 10 +++--- game/items/background.py | 2 +- game/items/item.py | 2 +- game/menu.py | 2 +- game/scene.py | 4 +-- game/sidepanel.py | 2 +- lib/engine/shader.py | 4 --- lib/engine/vec.py | 3 -- main.py | 2 +- prj.org | 3 +- setup.py | 18 +++++----- tests/functional_test.py | 8 ++--- tests/lib/build/test_build.py | 2 +- tests/lib/build/test_lang.py | 2 +- tests/lib/build/test_models.py | 2 +- tests/lib/build/test_mtprocesser.py | 2 +- tests/lib/engine/test_audio.py | 4 +-- tests/lib/engine/test_cbmux.py | 2 +- tests/lib/engine/test_clock.py | 4 +-- tests/lib/engine/test_configuration.py | 4 +-- tests/lib/engine/test_engine.py | 4 +-- tests/lib/engine/test_event.py | 4 +-- tests/lib/engine/test_font.py | 2 +- tests/lib/engine/test_gfx.py | 4 +-- tests/lib/engine/test_joystick.py | 6 ++-- tests/lib/test_computer_proxy.py | 6 ++-- tests/lib/test_dictfile.py | 2 +- tests/lib/test_game.py | 8 ++--- tests/lib/test_gameobject.py | 4 +-- tests/lib/test_observer.py | 2 +- tests/test_functional.py | 2 +- tests/test_setup.py | 2 +- {lib => ya2}/__init__.py | 0 {lib => ya2}/build/__init__.py | 0 {lib => ya2}/build/blend2gltf.py | 0 {lib => ya2}/build/build.py | 0 {lib => ya2}/build/commands.patch | 0 {lib => ya2}/build/docs.py | 2 +- {lib => ya2}/build/images.py | 2 +- {lib => ya2}/build/in_venv.sh | 0 {lib => ya2}/build/lang.py | 2 +- {lib => ya2}/build/models.py | 6 ++-- {lib => ya2}/build/mtprocesser.py | 0 {lib => ya2}/build/screenshots.py | 0 {lib => ya2}/computer_proxy.py | 0 {lib => ya2}/decorator.py | 0 {lib => ya2}/dictfile.py | 4 +-- {lib => ya2}/engine/__init__.py | 0 {lib => ya2}/engine/audio.py | 4 +-- {lib => ya2}/engine/cbmux.py | 0 {lib => ya2}/engine/clock.py | 0 {lib => ya2}/engine/configuration.py | 2 +- {lib => ya2}/engine/engine.py | 40 +++++++++++------------ {lib => ya2}/engine/enginefacade.py | 0 {lib => ya2}/engine/event.py | 4 +-- {lib => ya2}/engine/font.py | 2 +- {lib => ya2}/engine/functional.py | 4 +-- {lib => ya2}/engine/gfx.py | 6 ++-- {lib => ya2}/engine/gui/__init__.py | 0 {lib => ya2}/engine/gui/browser.py | 0 {lib => ya2}/engine/gui/circle.py | 6 ++-- {lib => ya2}/engine/gui/cursor.py | 4 +-- {lib => ya2}/engine/gui/gui.py | 6 ++-- {lib => ya2}/engine/gui/imgbtn.py | 4 +-- {lib => ya2}/engine/gui/mainpage.py | 6 ++-- {lib => ya2}/engine/gui/menu.py | 6 ++-- {lib => ya2}/engine/gui/page.py | 10 +++--- {lib => ya2}/engine/joystick.py | 4 +-- {lib => ya2}/engine/lang.py | 2 +- {lib => ya2}/engine/log.py | 4 +-- {lib => ya2}/engine/logic.py | 8 ++--- {lib => ya2}/engine/network/__init__.py | 0 {lib => ya2}/engine/network/binary.py | 0 {lib => ya2}/engine/network/client.py | 4 +-- {lib => ya2}/engine/network/network.py | 4 +-- {lib => ya2}/engine/network/server.py | 6 ++-- {lib => ya2}/engine/particle.py | 2 +- {lib => ya2}/engine/pause.py | 4 +-- {lib => ya2}/engine/phys.py | 4 +-- {lib => ya2}/engine/profiler.py | 0 ya2/engine/shader.py | 4 +++ ya2/engine/vec.py | 3 ++ {lib => ya2}/facade.py | 0 {lib => ya2}/game.py | 4 +-- {lib => ya2}/gameobject.py | 2 +- {lib => ya2}/lib/__init__.py | 0 {lib => ya2}/lib/builder.py | 2 +- {lib => ya2}/lib/bullet/__init__.py | 0 {lib => ya2}/lib/bullet/bullet.py | 0 {lib => ya2}/lib/gui.py | 2 +- {lib => ya2}/lib/ivals.py | 2 +- {lib => ya2}/lib/p3d/__init__.py | 0 {lib => ya2}/lib/p3d/audio.py | 0 {lib => ya2}/lib/p3d/gfx.py | 2 +- {lib => ya2}/lib/p3d/gui.py | 8 ++--- {lib => ya2}/lib/p3d/ivals.py | 0 {lib => ya2}/lib/p3d/joystick.py | 0 {lib => ya2}/lib/p3d/p3d.py | 0 {lib => ya2}/lib/p3d/particle.py | 6 ++-- {lib => ya2}/lib/p3d/pause.py | 2 +- {lib => ya2}/lib/p3d/shader.py | 2 +- {lib => ya2}/lib/p3d/vec.py | 0 {lib => ya2}/lib/p3d/widget.py | 2 +- {lib => ya2}/observer.py | 0 {lib => ya2}/tools/apply_gloss.py | 0 {lib => ya2}/tools/build_metal_texture.py | 0 {lib => ya2}/tools/fix_mask_texture.py | 0 {lib => ya2}/tools/kill_yorg.py | 0 {lib => ya2}/tools/kill_yorg_server.py | 0 {lib => ya2}/tools/pdfsingle.py | 4 +-- {lib => ya2}/tools/process_models.py | 4 +-- {lib => ya2}/tools/set_diffuse.py | 0 112 files changed, 170 insertions(+), 169 deletions(-) delete mode 100644 lib/engine/shader.py delete mode 100644 lib/engine/vec.py rename {lib => ya2}/__init__.py (100%) rename {lib => ya2}/build/__init__.py (100%) rename {lib => ya2}/build/blend2gltf.py (100%) rename {lib => ya2}/build/build.py (100%) rename {lib => ya2}/build/commands.patch (100%) rename {lib => ya2}/build/docs.py (97%) rename {lib => ya2}/build/images.py (89%) rename {lib => ya2}/build/in_venv.sh (100%) rename {lib => ya2}/build/lang.py (98%) rename {lib => ya2}/build/models.py (97%) rename {lib => ya2}/build/mtprocesser.py (100%) rename {lib => ya2}/build/screenshots.py (100%) rename {lib => ya2}/computer_proxy.py (100%) rename {lib => ya2}/decorator.py (100%) rename {lib => ya2}/dictfile.py (97%) rename {lib => ya2}/engine/__init__.py (100%) rename {lib => ya2}/engine/audio.py (74%) rename {lib => ya2}/engine/cbmux.py (100%) rename {lib => ya2}/engine/clock.py (100%) rename {lib => ya2}/engine/configuration.py (99%) rename {lib => ya2}/engine/engine.py (75%) rename {lib => ya2}/engine/enginefacade.py (100%) rename {lib => ya2}/engine/event.py (95%) rename {lib => ya2}/engine/font.py (91%) rename {lib => ya2}/engine/functional.py (99%) rename {lib => ya2}/engine/gfx.py (92%) rename {lib => ya2}/engine/gui/__init__.py (100%) rename {lib => ya2}/engine/gui/browser.py (100%) rename {lib => ya2}/engine/gui/circle.py (92%) rename {lib => ya2}/engine/gui/cursor.py (97%) rename {lib => ya2}/engine/gui/gui.py (94%) rename {lib => ya2}/engine/gui/imgbtn.py (92%) rename {lib => ya2}/engine/gui/mainpage.py (93%) rename {lib => ya2}/engine/gui/menu.py (97%) rename {lib => ya2}/engine/gui/page.py (97%) rename {lib => ya2}/engine/joystick.py (98%) rename {lib => ya2}/engine/lang.py (97%) rename {lib => ya2}/engine/log.py (99%) rename {lib => ya2}/engine/logic.py (92%) rename {lib => ya2}/engine/network/__init__.py (100%) rename {lib => ya2}/engine/network/binary.py (100%) rename {lib => ya2}/engine/network/client.py (94%) rename {lib => ya2}/engine/network/network.py (98%) rename {lib => ya2}/engine/network/server.py (95%) rename {lib => ya2}/engine/particle.py (92%) rename {lib => ya2}/engine/pause.py (95%) rename {lib => ya2}/engine/phys.py (98%) rename {lib => ya2}/engine/profiler.py (100%) create mode 100644 ya2/engine/shader.py create mode 100644 ya2/engine/vec.py rename {lib => ya2}/facade.py (100%) rename {lib => ya2}/game.py (89%) rename {lib => ya2}/gameobject.py (98%) rename {lib => ya2}/lib/__init__.py (100%) rename {lib => ya2}/lib/builder.py (91%) rename {lib => ya2}/lib/bullet/__init__.py (100%) rename {lib => ya2}/lib/bullet/bullet.py (100%) rename {lib => ya2}/lib/gui.py (86%) rename {lib => ya2}/lib/ivals.py (75%) rename {lib => ya2}/lib/p3d/__init__.py (100%) rename {lib => ya2}/lib/p3d/audio.py (100%) rename {lib => ya2}/lib/p3d/gfx.py (99%) rename {lib => ya2}/lib/p3d/gui.py (98%) rename {lib => ya2}/lib/p3d/ivals.py (100%) rename {lib => ya2}/lib/p3d/joystick.py (100%) rename {lib => ya2}/lib/p3d/p3d.py (100%) rename {lib => ya2}/lib/p3d/particle.py (98%) rename {lib => ya2}/lib/p3d/pause.py (99%) rename {lib => ya2}/lib/p3d/shader.py (99%) rename {lib => ya2}/lib/p3d/vec.py (100%) rename {lib => ya2}/lib/p3d/widget.py (99%) rename {lib => ya2}/observer.py (100%) rename {lib => ya2}/tools/apply_gloss.py (100%) rename {lib => ya2}/tools/build_metal_texture.py (100%) rename {lib => ya2}/tools/fix_mask_texture.py (100%) rename {lib => ya2}/tools/kill_yorg.py (100%) rename {lib => ya2}/tools/kill_yorg_server.py (100%) rename {lib => ya2}/tools/pdfsingle.py (90%) rename {lib => ya2}/tools/process_models.py (71%) rename {lib => ya2}/tools/set_diffuse.py (100%) diff --git a/game/app.py b/game/app.py index 057a680..ac75b5c 100755 --- a/game/app.py +++ b/game/app.py @@ -25,11 +25,11 @@ from game.scenes.scene_domino_box import SceneDominoBox from game.scenes.scene_domino import SceneDomino from game.scenes.scene_teeter_domino_box_basketball import SceneTeeterDominoBoxBasketball from game.scenes.scene_teeter_tooter import SceneTeeterTooter -from lib.dictfile import DctFile -from lib.lib.p3d.p3d import LibP3d -from lib.engine.lang import LangMgr -from lib.engine.log import LogMgr -from lib.engine.functional import FunctionalTest +from ya2.dictfile import DctFile +from ya2.lib.p3d.p3d import LibP3d +from ya2.engine.lang import LangMgr +from ya2.engine.log import LogMgr +from ya2.engine.functional import FunctionalTest class MainFsm(FSM): diff --git a/game/items/background.py b/game/items/background.py index 8702543..2d83fc0 100644 --- a/game/items/background.py +++ b/game/items/background.py @@ -1,6 +1,6 @@ from itertools import product from panda3d.core import NodePath -from lib.lib.p3d.gfx import set_srgb +from ya2.lib.p3d.gfx import set_srgb class Background: diff --git a/game/items/item.py b/game/items/item.py index fabd391..9eb5afb 100644 --- a/game/items/item.py +++ b/game/items/item.py @@ -2,7 +2,7 @@ from panda3d.core import CullFaceAttrib, Point3, NodePath, Point2, Texture, \ Plane, Vec3, BitMask32 from panda3d.bullet import BulletBoxShape, BulletRigidBodyNode, BulletGhostNode from direct.gui.OnscreenText import OnscreenText -from lib.lib.p3d.gfx import P3dGfxMgr, set_srgb +from ya2.lib.p3d.gfx import P3dGfxMgr, set_srgb class Command: diff --git a/game/menu.py b/game/menu.py index 57f628a..b20889a 100644 --- a/game/menu.py +++ b/game/menu.py @@ -12,7 +12,7 @@ from direct.gui.DirectGui import DirectButton, DirectCheckButton, \ from direct.gui.DirectGuiGlobals import FLAT from direct.gui.OnscreenText import OnscreenText from direct.showbase.DirectObject import DirectObject -from lib.engine.gui.cursor import MouseCursor +from ya2.engine.gui.cursor import MouseCursor from game.scene import Scene from panda3d.bullet import BulletWorld diff --git a/game/scene.py b/game/scene.py index e049c4b..6cdf9f9 100644 --- a/game/scene.py +++ b/game/scene.py @@ -14,8 +14,8 @@ from direct.gui.DirectGuiGlobals import FLAT, DISABLED, NORMAL from direct.showbase.DirectObject import DirectObject from game.items.background import Background from game.sidepanel import SidePanel -from lib.engine.gui.cursor import MouseCursor -from lib.lib.p3d.gfx import P3dGfxMgr +from ya2.engine.gui.cursor import MouseCursor +from ya2.lib.p3d.gfx import P3dGfxMgr class Scene(DirectObject): diff --git a/game/sidepanel.py b/game/sidepanel.py index 82ae30f..ee59d7d 100644 --- a/game/sidepanel.py +++ b/game/sidepanel.py @@ -1,7 +1,7 @@ from textwrap import dedent from panda3d.core import GeomVertexData, GeomVertexFormat, Geom, \ GeomVertexWriter, GeomTriangles, GeomNode, Shader, Point3, Plane, Vec3 -from lib.lib.p3d.gfx import P3dGfxMgr +from ya2.lib.p3d.gfx import P3dGfxMgr class SidePanel: diff --git a/lib/engine/shader.py b/lib/engine/shader.py deleted file mode 100644 index d81742c..0000000 --- a/lib/engine/shader.py +++ /dev/null @@ -1,4 +0,0 @@ -from lib.lib.p3d.shader import P3dShaderMgr - - -ShaderMgr = P3dShaderMgr diff --git a/lib/engine/vec.py b/lib/engine/vec.py deleted file mode 100644 index 9e94f55..0000000 --- a/lib/engine/vec.py +++ /dev/null @@ -1,3 +0,0 @@ -from lib.lib.p3d.vec import P3dVec2, P3dVec3 -Vec = P3dVec3 -Vec2 = P3dVec2 diff --git a/main.py b/main.py index aad78e0..3d4b45f 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ '''This is the main file. This launches the application.''' -import lib.engine.log # so logging's info/debug are logged +import ya2.engine.log # so logging's info/debug are logged from sys import argv from panda3d.core import load_prc_file_data if '--version' in argv: diff --git a/prj.org b/prj.org index 9ed1ea5..9cbfad8 100644 --- a/prj.org +++ b/prj.org @@ -3,11 +3,12 @@ #+CATEGORY: pmachines #+TAGS: bug(b) calendar(c) waiting(w) -* RED rename lib to ya2 +* RED remove unused code * READY refactoring * BACKLOG improve level domino box basketball: it can be solved trivially * BACKLOG do intro video with moviepy * BACKLOG optimize slow tests +* BACKLOG implement functional tests with xmlrpc; retrieve the coordinates with rpc * BACKLOG intro animation (from target item to start position) * BACKLOG buttons of the scenes enabled sequentially - [ ] each scene has a version diff --git a/setup.py b/setup.py index 83b7330..6a8e971 100644 --- a/setup.py +++ b/setup.py @@ -11,15 +11,15 @@ from setuptools import setup, Command from setuptools.command.develop import develop from multiprocessing import cpu_count from direct.dist.commands import bdist_apps -from lib.build.build import branch, files, ver, files, bld_dpath -from lib.build.docs import bld_docs -from lib.build.models import ModelsBuilder -from lib.build.images import bld_images -from lib.build.screenshots import bld_screenshots -from lib.build.lang import LanguageBuilder +from ya2.build.build import branch, files, ver, files, bld_dpath +from ya2.build.docs import bld_docs +from ya2.build.models import ModelsBuilder +from ya2.build.images import bld_images +from ya2.build.screenshots import bld_screenshots +from ya2.build.lang import LanguageBuilder from p3d_appimage import AppImageBuilder from p3d_flatpak import FlatpakBuilder -import lib.engine.log # so logging's info/debug are logged +import ya2.engine.log # so logging's info/debug are logged from game.app import PmachinesApp @@ -122,7 +122,7 @@ class BDistAppsCmd(bdist_apps): print(msg) cmd = 'patch --forward ' + \ '../venv/lib/python3.7/site-packages/direct/dist/commands.py' + \ - ' lib/build/commands.patch' + ' ya2/build/commands.patch' system(cmd) bdist_apps.run(self) if not self.nolinux: @@ -192,7 +192,7 @@ if __name__ == '__main__': 'assets/images/icon/icon32.png', 'assets/images/icon/icon16.png']}, 'include_patterns': [ - '**/lib/licenses/*', + '**/ya2/licenses/*', '**/licenses/*', '**/*.bam', '**/*.dds', diff --git a/tests/functional_test.py b/tests/functional_test.py index de53cdd..c236c9a 100644 --- a/tests/functional_test.py +++ b/tests/functional_test.py @@ -1,8 +1,8 @@ '''Create ref: * M-x fla-set-fun-test * rm options.ini -* python main.py --functional-test --functional-ref & python -m lib.tools.functional_test.py 1 -* python main.py --functional-test --functional-ref & python -m lib.tools.functional_test.py 2 +* python main.py --functional-test --functional-ref & python -m ya2.tools.functional_test.py 1 +* python main.py --functional-test --functional-ref & python -m ya2.tools.functional_test.py 2 * M-x fla-unset-fun-test''' from panda3d.core import load_prc_file_data load_prc_file_data('', 'window-type none') @@ -20,8 +20,8 @@ from sys import exit, argv from panda3d.core import Filename from direct.showbase.ShowBase import ShowBase from direct.gui.OnscreenText import OnscreenText -from lib.gameobject import GameObject -from lib.build.build import _branch +from ya2.gameobject import GameObject +from ya2.build.build import _branch class FunctionalTest(GameObject): diff --git a/tests/lib/build/test_build.py b/tests/lib/build/test_build.py index 1537555..6713add 100644 --- a/tests/lib/build/test_build.py +++ b/tests/lib/build/test_build.py @@ -8,7 +8,7 @@ from os.path import basename from shutil import rmtree from unittest import TestCase from re import compile -from lib.build.build import InsideDir, files, exec_cmd, _branch, _version, \ +from ya2.build.build import InsideDir, files, exec_cmd, _branch, _version, \ to_be_built diff --git a/tests/lib/build/test_lang.py b/tests/lib/build/test_lang.py index 29902b2..9ccf7cf 100644 --- a/tests/lib/build/test_lang.py +++ b/tests/lib/build/test_lang.py @@ -6,7 +6,7 @@ from os import remove, makedirs from os.path import exists from shutil import rmtree, copy from unittest import TestCase -from lib.build.lang import LanguageBuilder +from ya2.build.lang import LanguageBuilder class LangTests(TestCase): diff --git a/tests/lib/build/test_models.py b/tests/lib/build/test_models.py index 8b97451..e569670 100644 --- a/tests/lib/build/test_models.py +++ b/tests/lib/build/test_models.py @@ -8,7 +8,7 @@ from shutil import rmtree, copy from unittest import TestCase from itertools import product from time import time -from lib.build.models import ModelsBuilder +from ya2.build.models import ModelsBuilder class ModelsBuilderTests(TestCase): diff --git a/tests/lib/build/test_mtprocesser.py b/tests/lib/build/test_mtprocesser.py index f305ee3..536cf7c 100644 --- a/tests/lib/build/test_mtprocesser.py +++ b/tests/lib/build/test_mtprocesser.py @@ -8,7 +8,7 @@ sys.path.append(str(Path(__file__).parent.parent.parent.parent)) from pathlib import Path from os.path import exists from unittest import TestCase -from lib.build.mtprocesser import ProcesserMgr +from ya2.build.mtprocesser import ProcesserMgr class ProcesserMgrTests(TestCase): diff --git a/tests/lib/engine/test_audio.py b/tests/lib/engine/test_audio.py index 08589bb..2b1cf76 100644 --- a/tests/lib/engine/test_audio.py +++ b/tests/lib/engine/test_audio.py @@ -4,8 +4,8 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.engine.audio import EngineAudio +from ya2.engine.engine import Engine +from ya2.engine.audio import EngineAudio class EngineAudioTests(TestCase): diff --git a/tests/lib/engine/test_cbmux.py b/tests/lib/engine/test_cbmux.py index b2ee438..8a10040 100644 --- a/tests/lib/engine/test_cbmux.py +++ b/tests/lib/engine/test_cbmux.py @@ -5,7 +5,7 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from unittest.mock import MagicMock from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine +from ya2.engine.engine import Engine class EngineCBMuxTests(TestCase): diff --git a/tests/lib/engine/test_clock.py b/tests/lib/engine/test_clock.py index 2ec04d0..9c6e88a 100644 --- a/tests/lib/engine/test_clock.py +++ b/tests/lib/engine/test_clock.py @@ -5,8 +5,8 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from unittest.mock import MagicMock from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.engine.audio import EngineAudio +from ya2.engine.engine import Engine +from ya2.engine.audio import EngineAudio class EngineClockTests(TestCase): diff --git a/tests/lib/engine/test_configuration.py b/tests/lib/engine/test_configuration.py index 09a5898..974a502 100644 --- a/tests/lib/engine/test_configuration.py +++ b/tests/lib/engine/test_configuration.py @@ -5,8 +5,8 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from unittest.mock import MagicMock from panda3d.core import loadPrcFileData, ConfigVariableInt, ConfigVariableString -from lib.engine.engine import Engine -from lib.engine.configuration import Cfg +from ya2.engine.engine import Engine +from ya2.engine.configuration import Cfg class EngineConfigurationTests(TestCase): diff --git a/tests/lib/engine/test_engine.py b/tests/lib/engine/test_engine.py index 3453979..4cb3c97 100644 --- a/tests/lib/engine/test_engine.py +++ b/tests/lib/engine/test_engine.py @@ -5,8 +5,8 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest.mock import create_autospec from unittest import TestCase from panda3d.core import loadPrcFileData, NodePath, ConfigVariableBool -from lib.engine.engine import Engine -from lib.engine.configuration import Cfg, CursorCfg +from ya2.engine.engine import Engine +from ya2.engine.configuration import Cfg, CursorCfg class ConfigurationTests(TestCase): diff --git a/tests/lib/engine/test_event.py b/tests/lib/engine/test_event.py index b6ee720..d1e030a 100644 --- a/tests/lib/engine/test_event.py +++ b/tests/lib/engine/test_event.py @@ -5,8 +5,8 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from unittest.mock import patch, create_autospec from panda3d.core import loadPrcFileData, GraphicsWindow -from lib.engine.engine import Engine -from lib.engine.event import EngineEvent +from ya2.engine.engine import Engine +from ya2.engine.event import EngineEvent class EngineEventTests(TestCase): diff --git a/tests/lib/engine/test_font.py b/tests/lib/engine/test_font.py index 5e6bc82..b9e98c7 100644 --- a/tests/lib/engine/test_font.py +++ b/tests/lib/engine/test_font.py @@ -4,7 +4,7 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData, DynamicTextFont -from lib.engine.engine import Engine +from ya2.engine.engine import Engine class EngineFontTests(TestCase): diff --git a/tests/lib/engine/test_gfx.py b/tests/lib/engine/test_gfx.py index 3e8173f..b80c75f 100644 --- a/tests/lib/engine/test_gfx.py +++ b/tests/lib/engine/test_gfx.py @@ -4,8 +4,8 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.lib.p3d.gfx import P3dNode +from ya2.engine.engine import Engine +from ya2.lib.p3d.gfx import P3dNode class EngineGfxTests(TestCase): diff --git a/tests/lib/engine/test_joystick.py b/tests/lib/engine/test_joystick.py index b73de6b..a4b55a2 100644 --- a/tests/lib/engine/test_joystick.py +++ b/tests/lib/engine/test_joystick.py @@ -4,9 +4,9 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.engine.joystick import JoystickMgr, JoystickState -from lib.engine.gui.menu import NavInfoPerPlayer +from ya2.engine.engine import Engine +from ya2.engine.joystick import JoystickMgr, JoystickState +from ya2.engine.gui.menu import NavInfoPerPlayer class EngineJoystickTests(TestCase): diff --git a/tests/lib/test_computer_proxy.py b/tests/lib/test_computer_proxy.py index f9fdad5..9b98c3d 100644 --- a/tests/lib/test_computer_proxy.py +++ b/tests/lib/test_computer_proxy.py @@ -4,9 +4,9 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.gameobject import GameObject -from lib.engine.engine import Engine -from lib.computer_proxy import ComputerProxy, compute_once, once_a_frame +from ya2.gameobject import GameObject +from ya2.engine.engine import Engine +from ya2.computer_proxy import ComputerProxy, compute_once, once_a_frame class ExampleProxy(GameObject, ComputerProxy): diff --git a/tests/lib/test_dictfile.py b/tests/lib/test_dictfile.py index 7afa359..a96006c 100644 --- a/tests/lib/test_dictfile.py +++ b/tests/lib/test_dictfile.py @@ -5,7 +5,7 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from os import remove from os.path import exists from unittest import TestCase -from lib.dictfile import DctFile +from ya2.dictfile import DctFile class DictFileTests(TestCase): diff --git a/tests/lib/test_game.py b/tests/lib/test_game.py index 1ef8f07..89e23cc 100644 --- a/tests/lib/test_game.py +++ b/tests/lib/test_game.py @@ -4,10 +4,10 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.engine.configuration import Cfg -from lib.game import GameLogic, Game -from lib.gameobject import GameObject, FsmColleague, AudioColleague, \ +from ya2.engine.engine import Engine +from ya2.engine.configuration import Cfg +from ya2.game import GameLogic, Game +from ya2.gameobject import GameObject, FsmColleague, AudioColleague, \ EventColleague, LogicColleague diff --git a/tests/lib/test_gameobject.py b/tests/lib/test_gameobject.py index 010b9c0..c80f4df 100644 --- a/tests/lib/test_gameobject.py +++ b/tests/lib/test_gameobject.py @@ -5,8 +5,8 @@ sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest.mock import patch from unittest import TestCase from panda3d.core import loadPrcFileData -from lib.engine.engine import Engine -from lib.gameobject import AiColleague, AudioColleague, EventColleague, \ +from ya2.engine.engine import Engine +from ya2.gameobject import AiColleague, AudioColleague, EventColleague, \ FsmColleague, GameObject, GfxColleague, GuiColleague, LogicColleague, \ PhysColleague, Colleague diff --git a/tests/lib/test_observer.py b/tests/lib/test_observer.py index 7f4468d..ee07e5f 100644 --- a/tests/lib/test_observer.py +++ b/tests/lib/test_observer.py @@ -4,7 +4,7 @@ if '' in sys.path: sys.path.remove('') sys.path.append(str(Path(__file__).parent.parent.parent)) from unittest import TestCase from unittest.mock import MagicMock -from lib.observer import Subject +from ya2.observer import Subject class Observed(Subject): pass diff --git a/tests/test_functional.py b/tests/test_functional.py index b1a00bf..fbd89e0 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -12,7 +12,7 @@ from os import system, remove, environ from os.path import exists, basename, join from glob import glob from panda3d.core import Filename -from lib.build.build import exec_cmd, _branch, ver +from ya2.build.build import exec_cmd, _branch, ver class FunctionalTests(TestCase): diff --git a/tests/test_setup.py b/tests/test_setup.py index 22f9be0..9d16eb3 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -7,7 +7,7 @@ from os.path import exists from unittest import TestCase from setuptools.dist import Distribution from setup import AbsCmd -from lib.build.build import exec_cmd +from ya2.build.build import exec_cmd class SetupTests(TestCase): diff --git a/lib/__init__.py b/ya2/__init__.py similarity index 100% rename from lib/__init__.py rename to ya2/__init__.py diff --git a/lib/build/__init__.py b/ya2/build/__init__.py similarity index 100% rename from lib/build/__init__.py rename to ya2/build/__init__.py diff --git a/lib/build/blend2gltf.py b/ya2/build/blend2gltf.py similarity index 100% rename from lib/build/blend2gltf.py rename to ya2/build/blend2gltf.py diff --git a/lib/build/build.py b/ya2/build/build.py similarity index 100% rename from lib/build/build.py rename to ya2/build/build.py diff --git a/lib/build/commands.patch b/ya2/build/commands.patch similarity index 100% rename from lib/build/commands.patch rename to ya2/build/commands.patch diff --git a/lib/build/docs.py b/ya2/build/docs.py similarity index 97% rename from lib/build/docs.py rename to ya2/build/docs.py index 9b5aeeb..f926e28 100644 --- a/lib/build/docs.py +++ b/ya2/build/docs.py @@ -2,7 +2,7 @@ from os import system, mkdir, remove, rename from os.path import exists from shutil import rmtree, make_archive -from lib.build.build import InsideDir +from ya2.build.build import InsideDir from pathlib import Path from re import match, findall, sub from glob import glob diff --git a/lib/build/images.py b/ya2/build/images.py similarity index 89% rename from lib/build/images.py rename to ya2/build/images.py index 53e3021..839960a 100644 --- a/lib/build/images.py +++ b/ya2/build/images.py @@ -1,6 +1,6 @@ from os.path import dirname from sys import executable -from lib.build.mtprocesser import ProcesserMgr +from ya2.build.mtprocesser import ProcesserMgr #TODO refactor: make class ImagesBuilder diff --git a/lib/build/in_venv.sh b/ya2/build/in_venv.sh similarity index 100% rename from lib/build/in_venv.sh rename to ya2/build/in_venv.sh diff --git a/lib/build/lang.py b/ya2/build/lang.py similarity index 98% rename from lib/build/lang.py rename to ya2/build/lang.py index 2fcf666..3d58730 100644 --- a/lib/build/lang.py +++ b/ya2/build/lang.py @@ -2,7 +2,7 @@ from os import system, makedirs, remove from os.path import exists from shutil import move, copy -from lib.build.build import files +from ya2.build.build import files class LanguageBuilder: diff --git a/lib/build/models.py b/ya2/build/models.py similarity index 97% rename from lib/build/models.py rename to ya2/build/models.py index 73b2fb0..bf9f473 100644 --- a/lib/build/models.py +++ b/ya2/build/models.py @@ -6,8 +6,8 @@ from multiprocessing import Pool from glob import glob from hashlib import md5 from shutil import copyfile, move, rmtree -from lib.build.mtprocesser import ProcesserMgr -from lib.build.build import to_be_built +from ya2.build.mtprocesser import ProcesserMgr +from ya2.build.build import to_be_built class ModelsBuilder(): @@ -58,7 +58,7 @@ class ModelsBuilder(): rmtree(new_dir, ignore_errors=True) makedirs(new_dir) #files_before = [basename(gname) for gname in glob('./*')] - cmd = 'blender %s --background --python lib/build/blend2gltf.py ' + cmd = 'blender %s --background --python ya2/build/blend2gltf.py ' cmd += '-- %s.gltf' cmd = cmd % (_fname, new_dir + '/' + fname[:-6]) gltf_name = _fname.replace('assets/models/blend/', pgltf) diff --git a/lib/build/mtprocesser.py b/ya2/build/mtprocesser.py similarity index 100% rename from lib/build/mtprocesser.py rename to ya2/build/mtprocesser.py diff --git a/lib/build/screenshots.py b/ya2/build/screenshots.py similarity index 100% rename from lib/build/screenshots.py rename to ya2/build/screenshots.py diff --git a/lib/computer_proxy.py b/ya2/computer_proxy.py similarity index 100% rename from lib/computer_proxy.py rename to ya2/computer_proxy.py diff --git a/lib/decorator.py b/ya2/decorator.py similarity index 100% rename from lib/decorator.py rename to ya2/decorator.py diff --git a/lib/dictfile.py b/ya2/dictfile.py similarity index 97% rename from lib/dictfile.py rename to ya2/dictfile.py index fcf652b..5495b3a 100644 --- a/lib/dictfile.py +++ b/ya2/dictfile.py @@ -5,8 +5,8 @@ from os.path import dirname from collections.abc import Mapping from configparser import ConfigParser from json import load, dumps -from lib.gameobject import GameObject -from lib.lib.builder import LibP3d +from ya2.gameobject import GameObject +from ya2.lib.builder import LibP3d class DctFile(GameObject): diff --git a/lib/engine/__init__.py b/ya2/engine/__init__.py similarity index 100% rename from lib/engine/__init__.py rename to ya2/engine/__init__.py diff --git a/lib/engine/audio.py b/ya2/engine/audio.py similarity index 74% rename from lib/engine/audio.py rename to ya2/engine/audio.py index 8cbe80c..9a70dea 100644 --- a/lib/engine/audio.py +++ b/ya2/engine/audio.py @@ -1,5 +1,5 @@ -from lib.gameobject import AudioColleague -from lib.lib.p3d.audio import P3dSound +from ya2.gameobject import AudioColleague +from ya2.lib.p3d.audio import P3dSound AudioSound = P3dSound diff --git a/lib/engine/cbmux.py b/ya2/engine/cbmux.py similarity index 100% rename from lib/engine/cbmux.py rename to ya2/engine/cbmux.py diff --git a/lib/engine/clock.py b/ya2/engine/clock.py similarity index 100% rename from lib/engine/clock.py rename to ya2/engine/clock.py diff --git a/lib/engine/configuration.py b/ya2/engine/configuration.py similarity index 99% rename from lib/engine/configuration.py rename to ya2/engine/configuration.py index f26ef0d..e99c230 100644 --- a/lib/engine/configuration.py +++ b/ya2/engine/configuration.py @@ -1,5 +1,5 @@ from panda3d.core import load_prc_file_data -from lib.lib.builder import LibP3d +from ya2.lib.builder import LibP3d class GuiCfg: diff --git a/lib/engine/engine.py b/ya2/engine/engine.py similarity index 75% rename from lib/engine/engine.py rename to ya2/engine/engine.py index 3c2ce96..fed72da 100644 --- a/lib/engine/engine.py +++ b/ya2/engine/engine.py @@ -2,26 +2,26 @@ from sys import path from os.path import dirname, realpath path.append(dirname(realpath(__file__)) + '/../thirdparty') -from lib.lib.builder import LibBuilder -from lib.engine.pause import PauseMgr -from lib.engine.profiler import AbsProfiler -from lib.engine.shader import ShaderMgr -from lib.engine.log import LogMgr -from lib.engine.font import FontMgr -from lib.engine.phys import PhysMgr -from lib.engine.gfx import EngineGfx -from lib.engine.network.server import Server -from lib.engine.network.client import Client -from lib.engine.gui.gui import EngineGui -from lib.engine.logic import EngineLogic -from lib.engine.event import EngineEvent -from lib.engine.audio import EngineAudio -from lib.engine.lang import LangMgr -from lib.gameobject import GameObject, Colleague -from lib.engine.enginefacade import EngineFacade -from lib.engine.configuration import Cfg -from lib.engine.cbmux import CallbackMux -from lib.engine.clock import Clock +from ya2.lib.builder import LibBuilder +from ya2.engine.pause import PauseMgr +from ya2.engine.profiler import AbsProfiler +from ya2.engine.shader import ShaderMgr +from ya2.engine.log import LogMgr +from ya2.engine.font import FontMgr +from ya2.engine.phys import PhysMgr +from ya2.engine.gfx import EngineGfx +from ya2.engine.network.server import Server +from ya2.engine.network.client import Client +from ya2.engine.gui.gui import EngineGui +from ya2.engine.logic import EngineLogic +from ya2.engine.event import EngineEvent +from ya2.engine.audio import EngineAudio +from ya2.engine.lang import LangMgr +from ya2.gameobject import GameObject, Colleague +from ya2.engine.enginefacade import EngineFacade +from ya2.engine.configuration import Cfg +from ya2.engine.cbmux import CallbackMux +from ya2.engine.clock import Clock class Engine(GameObject, EngineFacade): diff --git a/lib/engine/enginefacade.py b/ya2/engine/enginefacade.py similarity index 100% rename from lib/engine/enginefacade.py rename to ya2/engine/enginefacade.py diff --git a/lib/engine/event.py b/ya2/engine/event.py similarity index 95% rename from lib/engine/event.py rename to ya2/engine/event.py index bff03a2..8a57a24 100644 --- a/lib/engine/event.py +++ b/ya2/engine/event.py @@ -1,7 +1,7 @@ from time import time from logging import info -from lib.gameobject import EventColleague -from lib.engine.joystick import JoystickMgr +from ya2.gameobject import EventColleague +from ya2.engine.joystick import JoystickMgr class EngineEvent(EventColleague): diff --git a/lib/engine/font.py b/ya2/engine/font.py similarity index 91% rename from lib/engine/font.py rename to ya2/engine/font.py index 4ab9d01..855e06c 100644 --- a/lib/engine/font.py +++ b/ya2/engine/font.py @@ -1,4 +1,4 @@ -from lib.gameobject import GameObject +from ya2.gameobject import GameObject class FontMgr(GameObject): diff --git a/lib/engine/functional.py b/ya2/engine/functional.py similarity index 99% rename from lib/engine/functional.py rename to ya2/engine/functional.py index dffa678..05dfa78 100644 --- a/lib/engine/functional.py +++ b/ya2/engine/functional.py @@ -11,8 +11,8 @@ from multiprocessing.connection import Listener from threading import Thread from panda3d.core import Filename from direct.gui.OnscreenText import OnscreenText -from lib.gameobject import GameObject -from lib.build.build import _branch +from ya2.gameobject import GameObject +from ya2.build.build import _branch class ListenerThread(Thread): diff --git a/lib/engine/gfx.py b/ya2/engine/gfx.py similarity index 92% rename from lib/engine/gfx.py rename to ya2/engine/gfx.py index 0031c8f..9b320ea 100755 --- a/lib/engine/gfx.py +++ b/ya2/engine/gfx.py @@ -1,8 +1,8 @@ from math import pi from panda3d.core import ClockObject -from lib.gameobject import GfxColleague -from lib.engine.particle import Particle -from lib.lib.p3d.gfx import P3dGfxMgr, P3dAnimNode, P3dAmbientLight, \ +from ya2.gameobject import GfxColleague +from ya2.engine.particle import Particle +from ya2.lib.p3d.gfx import P3dGfxMgr, P3dAnimNode, P3dAmbientLight, \ P3dSpotlight diff --git a/lib/engine/gui/__init__.py b/ya2/engine/gui/__init__.py similarity index 100% rename from lib/engine/gui/__init__.py rename to ya2/engine/gui/__init__.py diff --git a/lib/engine/gui/browser.py b/ya2/engine/gui/browser.py similarity index 100% rename from lib/engine/gui/browser.py rename to ya2/engine/gui/browser.py diff --git a/lib/engine/gui/circle.py b/ya2/engine/gui/circle.py similarity index 92% rename from lib/engine/gui/circle.py rename to ya2/engine/gui/circle.py index 351cb70..df45cce 100644 --- a/lib/engine/gui/circle.py +++ b/ya2/engine/gui/circle.py @@ -1,7 +1,7 @@ from os import name -from lib.lib.gui import Frame -from lib.lib.p3d.shader import load_shader -from lib.gameobject import GameObject +from ya2.lib.gui import Frame +from ya2.lib.p3d.shader import load_shader +from ya2.gameobject import GameObject class Circle(Frame, GameObject): diff --git a/lib/engine/gui/cursor.py b/ya2/engine/gui/cursor.py similarity index 97% rename from lib/engine/gui/cursor.py rename to ya2/engine/gui/cursor.py index 2e9724e..f3d0ff1 100644 --- a/lib/engine/gui/cursor.py +++ b/ya2/engine/gui/cursor.py @@ -1,6 +1,6 @@ from panda3d.core import GraphicsWindow, WindowProperties -from lib.lib.gui import Img -from lib.gameobject import GameObject +from ya2.lib.gui import Img +from ya2.gameobject import GameObject class MouseCursorFacade: diff --git a/lib/engine/gui/gui.py b/ya2/engine/gui/gui.py similarity index 94% rename from lib/engine/gui/gui.py rename to ya2/engine/gui/gui.py index 9395fba..699cce6 100755 --- a/lib/engine/gui/gui.py +++ b/ya2/engine/gui/gui.py @@ -1,7 +1,7 @@ from logging import info -from lib.gameobject import GuiColleague -from lib.engine.gui.cursor import MouseCursor -from lib.engine.gui.browser import Browser +from ya2.gameobject import GuiColleague +from ya2.engine.gui.cursor import MouseCursor +from ya2.engine.gui.browser import Browser up = (0, 1) diff --git a/lib/engine/gui/imgbtn.py b/ya2/engine/gui/imgbtn.py similarity index 92% rename from lib/engine/gui/imgbtn.py rename to ya2/engine/gui/imgbtn.py index 99d914f..467d752 100644 --- a/lib/engine/gui/imgbtn.py +++ b/ya2/engine/gui/imgbtn.py @@ -1,5 +1,5 @@ -from lib.lib.gui import Btn -from lib.lib.p3d.shader import load_shader +from ya2.lib.gui import Btn +from ya2.lib.p3d.shader import load_shader class ImgBtn(Btn): diff --git a/lib/engine/gui/mainpage.py b/ya2/engine/gui/mainpage.py similarity index 93% rename from lib/engine/gui/mainpage.py rename to ya2/engine/gui/mainpage.py index 5e85b2d..1868329 100644 --- a/lib/engine/gui/mainpage.py +++ b/ya2/engine/gui/mainpage.py @@ -1,6 +1,6 @@ -from lib.lib.gui import Text, Img -from lib.engine.gui.page import Page, PageGui, PageFacade -from lib.engine.gui.imgbtn import ImgBtn +from ya2.lib.gui import Text, Img +from ya2.engine.gui.page import Page, PageGui, PageFacade +from ya2.engine.gui.imgbtn import ImgBtn class MainPageGui(PageGui): diff --git a/lib/engine/gui/menu.py b/ya2/engine/gui/menu.py similarity index 97% rename from lib/engine/gui/menu.py rename to ya2/engine/gui/menu.py index 7ad105c..bc848aa 100644 --- a/lib/engine/gui/menu.py +++ b/ya2/engine/gui/menu.py @@ -1,7 +1,7 @@ from direct.gui.DirectGuiGlobals import FLAT -from lib.gameobject import GuiColleague, LogicColleague, GameObject -from lib.lib.gui import Img -from lib.engine.audio import AudioSound +from ya2.gameobject import GuiColleague, LogicColleague, GameObject +from ya2.lib.gui import Img +from ya2.engine.audio import AudioSound class NavInfoPerPlayer: diff --git a/lib/engine/gui/page.py b/ya2/engine/gui/page.py similarity index 97% rename from lib/engine/gui/page.py rename to ya2/engine/gui/page.py index f046c61..1912797 100755 --- a/lib/engine/gui/page.py +++ b/ya2/engine/gui/page.py @@ -1,9 +1,9 @@ from inspect import getmro -from lib.lib.gui import Btn, Slider, CheckBtn, OptionMenu, Entry -from lib.engine.vec import Vec2 -from lib.engine.gui.gui import left, right, up, down -from lib.gameobject import GameObject, GuiColleague, EventColleague -from lib.engine.gui.imgbtn import ImgBtn +from ya2.lib.gui import Btn, Slider, CheckBtn, OptionMenu, Entry +from ya2.engine.vec import Vec2 +from ya2.engine.gui.gui import left, right, up, down +from ya2.gameobject import GameObject, GuiColleague, EventColleague +from ya2.engine.gui.imgbtn import ImgBtn class PageGui(GuiColleague): diff --git a/lib/engine/joystick.py b/ya2/engine/joystick.py similarity index 98% rename from lib/engine/joystick.py rename to ya2/engine/joystick.py index fb86e5f..008943e 100644 --- a/lib/engine/joystick.py +++ b/ya2/engine/joystick.py @@ -1,5 +1,5 @@ -from lib.gameobject import GameObject -from lib.lib.p3d.joystick import P3dJoystickMgr as JoystickMgrLib +from ya2.gameobject import GameObject +from ya2.lib.p3d.joystick import P3dJoystickMgr as JoystickMgrLib class JoystickState: diff --git a/lib/engine/lang.py b/ya2/engine/lang.py similarity index 97% rename from lib/engine/lang.py rename to ya2/engine/lang.py index 09adde4..4c2074d 100644 --- a/lib/engine/lang.py +++ b/ya2/engine/lang.py @@ -2,7 +2,7 @@ from logging import info from os.path import join, exists, dirname from gettext import translation from pathlib import Path -from lib.gameobject import GameObject +from ya2.gameobject import GameObject import sys diff --git a/lib/engine/log.py b/ya2/engine/log.py similarity index 99% rename from lib/engine/log.py rename to ya2/engine/log.py index 329ca87..9aa9b4e 100755 --- a/lib/engine/log.py +++ b/ya2/engine/log.py @@ -16,8 +16,8 @@ from sys import version_info # from multiprocessing import cpu_count from panda3d.core import Filename, GraphicsWindow, PandaSystem from panda3d.bullet import get_bullet_version -from lib.gameobject import Colleague -from lib.lib.builder import LibP3d +from ya2.gameobject import Colleague +from ya2.lib.builder import LibP3d import sys diff --git a/lib/engine/logic.py b/ya2/engine/logic.py similarity index 92% rename from lib/engine/logic.py rename to ya2/engine/logic.py index 46affee..3474291 100755 --- a/lib/engine/logic.py +++ b/ya2/engine/logic.py @@ -1,10 +1,10 @@ from os.path import exists from logging import info from sys import argv -from lib.gameobject import LogicColleague -from lib.engine.configuration import Cfg -from lib.gameobject import GameObject -from lib.computer_proxy import ComputerProxy, compute_once +from ya2.gameobject import LogicColleague +from ya2.engine.configuration import Cfg +from ya2.gameobject import GameObject +from ya2.computer_proxy import ComputerProxy, compute_once class VersionChecker(GameObject, ComputerProxy): diff --git a/lib/engine/network/__init__.py b/ya2/engine/network/__init__.py similarity index 100% rename from lib/engine/network/__init__.py rename to ya2/engine/network/__init__.py diff --git a/lib/engine/network/binary.py b/ya2/engine/network/binary.py similarity index 100% rename from lib/engine/network/binary.py rename to ya2/engine/network/binary.py diff --git a/lib/engine/network/client.py b/ya2/engine/network/client.py similarity index 94% rename from lib/engine/network/client.py rename to ya2/engine/network/client.py index 4ae8852..1bc971f 100644 --- a/lib/engine/network/client.py +++ b/ya2/engine/network/client.py @@ -1,6 +1,6 @@ from queue import Queue -from lib.engine.network.network import AbsNetwork, NetworkThread, msg_rpc_call -from lib.engine.network.binary import BinaryData +from ya2.engine.network.network import AbsNetwork, NetworkThread, msg_rpc_call +from ya2.engine.network.binary import BinaryData class ClientThread(NetworkThread): diff --git a/lib/engine/network/network.py b/ya2/engine/network/network.py similarity index 98% rename from lib/engine/network/network.py rename to ya2/engine/network/network.py index 41b6180..f1e015c 100644 --- a/lib/engine/network/network.py +++ b/ya2/engine/network/network.py @@ -8,8 +8,8 @@ from queue import Empty from threading import Thread from struct import Struct, error as unpack_error from _thread import interrupt_main -from lib.gameobject import GameObject -from lib.engine.network.binary import BinaryData +from ya2.gameobject import GameObject +from ya2.engine.network.binary import BinaryData msg_rpc_call, msg_rpc_answ = range(2) diff --git a/lib/engine/network/server.py b/ya2/engine/network/server.py similarity index 95% rename from lib/engine/network/server.py rename to ya2/engine/network/server.py index c53ef88..da7f8b1 100644 --- a/lib/engine/network/server.py +++ b/ya2/engine/network/server.py @@ -1,9 +1,9 @@ from socket import error from queue import Queue -from lib.engine.network.network import AbsNetwork, NetworkThread, \ +from ya2.engine.network.network import AbsNetwork, NetworkThread, \ msg_rpc_answ -from lib.engine.network.binary import BinaryData -from lib.gameobject import GameObject +from ya2.engine.network.binary import BinaryData +from ya2.gameobject import GameObject class ServerThread(NetworkThread, GameObject): diff --git a/lib/engine/particle.py b/ya2/engine/particle.py similarity index 92% rename from lib/engine/particle.py rename to ya2/engine/particle.py index 462232d..32eb05d 100755 --- a/lib/engine/particle.py +++ b/ya2/engine/particle.py @@ -1,6 +1,6 @@ # from math import pi # from ..gameobject import GameObject -from lib.lib.p3d.particle import P3dParticle +from ya2.lib.p3d.particle import P3dParticle Particle = P3dParticle diff --git a/lib/engine/pause.py b/ya2/engine/pause.py similarity index 95% rename from lib/engine/pause.py rename to ya2/engine/pause.py index bd1f37c..097d16f 100644 --- a/lib/engine/pause.py +++ b/ya2/engine/pause.py @@ -1,7 +1,7 @@ from direct.gui.DirectFrame import DirectFrame -from lib.gameobject import GuiColleague, LogicColleague, GameObject, \ +from ya2.gameobject import GuiColleague, LogicColleague, GameObject, \ Colleague -from lib.lib.p3d.pause import P3dPause +from ya2.lib.p3d.pause import P3dPause LibPause = P3dPause diff --git a/lib/engine/phys.py b/ya2/engine/phys.py similarity index 98% rename from lib/engine/phys.py rename to ya2/engine/phys.py index 13b1956..dfc2ac4 100644 --- a/lib/engine/phys.py +++ b/ya2/engine/phys.py @@ -1,6 +1,6 @@ from logging import info -from lib.gameobject import Colleague -from lib.lib.bullet.bullet import ( +from ya2.gameobject import Colleague +from ya2.lib.bullet.bullet import ( BulletPhysWorld, BulletTriangleMesh, BulletTriangleMeshShape, BulletRigidBodyNode, BulletGhostNode) diff --git a/lib/engine/profiler.py b/ya2/engine/profiler.py similarity index 100% rename from lib/engine/profiler.py rename to ya2/engine/profiler.py diff --git a/ya2/engine/shader.py b/ya2/engine/shader.py new file mode 100644 index 0000000..af4311b --- /dev/null +++ b/ya2/engine/shader.py @@ -0,0 +1,4 @@ +from ya2.lib.p3d.shader import P3dShaderMgr + + +ShaderMgr = P3dShaderMgr diff --git a/ya2/engine/vec.py b/ya2/engine/vec.py new file mode 100644 index 0000000..19fbafb --- /dev/null +++ b/ya2/engine/vec.py @@ -0,0 +1,3 @@ +from ya2.lib.p3d.vec import P3dVec2, P3dVec3 +Vec = P3dVec3 +Vec2 = P3dVec2 diff --git a/lib/facade.py b/ya2/facade.py similarity index 100% rename from lib/facade.py rename to ya2/facade.py diff --git a/lib/game.py b/ya2/game.py similarity index 89% rename from lib/game.py rename to ya2/game.py index 490a843..4694b4e 100644 --- a/lib/game.py +++ b/ya2/game.py @@ -1,6 +1,6 @@ from abc import ABCMeta -from lib.gameobject import LogicColleague, GameObject -from lib.engine.engine import Engine +from ya2.gameobject import LogicColleague, GameObject +from ya2.engine.engine import Engine class GameLogic(LogicColleague): diff --git a/lib/gameobject.py b/ya2/gameobject.py similarity index 98% rename from lib/gameobject.py rename to ya2/gameobject.py index 58c69a6..82be1ca 100644 --- a/lib/gameobject.py +++ b/ya2/gameobject.py @@ -1,6 +1,6 @@ from direct.fsm.FSM import FSM from direct.showbase.DirectObject import DirectObject -from lib.observer import Subject +from ya2.observer import Subject class Colleague(Subject): diff --git a/lib/lib/__init__.py b/ya2/lib/__init__.py similarity index 100% rename from lib/lib/__init__.py rename to ya2/lib/__init__.py diff --git a/lib/lib/builder.py b/ya2/lib/builder.py similarity index 91% rename from lib/lib/builder.py rename to ya2/lib/builder.py index 287d95b..d86cdae 100644 --- a/lib/lib/builder.py +++ b/ya2/lib/builder.py @@ -1,4 +1,4 @@ -from lib.lib.p3d.p3d import LibP3d +from ya2.lib.p3d.p3d import LibP3d class LibBuilder: diff --git a/lib/lib/bullet/__init__.py b/ya2/lib/bullet/__init__.py similarity index 100% rename from lib/lib/bullet/__init__.py rename to ya2/lib/bullet/__init__.py diff --git a/lib/lib/bullet/bullet.py b/ya2/lib/bullet/bullet.py similarity index 100% rename from lib/lib/bullet/bullet.py rename to ya2/lib/bullet/bullet.py diff --git a/lib/lib/gui.py b/ya2/lib/gui.py similarity index 86% rename from lib/lib/gui.py rename to ya2/lib/gui.py index aad6ddd..799c425 100644 --- a/lib/lib/gui.py +++ b/ya2/lib/gui.py @@ -1,6 +1,6 @@ '''This module binds abstract GUI classes and actual implementation classes (for the Dependency Inversion Principle).''' -from lib.lib.p3d.gui import P3dImg, P3dBtn, P3dSlider, P3dCheckBtn, \ +from ya2.lib.p3d.gui import P3dImg, P3dBtn, P3dSlider, P3dCheckBtn, \ P3dOptionMenu, P3dEntry, P3dLabel, P3dTxt, P3dFrame, P3dScrolledFrame diff --git a/lib/lib/ivals.py b/ya2/lib/ivals.py similarity index 75% rename from lib/lib/ivals.py rename to ya2/lib/ivals.py index 0498328..279a463 100644 --- a/lib/lib/ivals.py +++ b/ya2/lib/ivals.py @@ -1,6 +1,6 @@ '''This module binds abstract interval classes and actual implementation classes (for the Dependency Inversion Principle).''' -from lib.lib.p3d.ivals import P3dSeq, P3dWait, P3dPosIval, P3dFunc +from ya2.lib.p3d.ivals import P3dSeq, P3dWait, P3dPosIval, P3dFunc Seq = P3dSeq diff --git a/lib/lib/p3d/__init__.py b/ya2/lib/p3d/__init__.py similarity index 100% rename from lib/lib/p3d/__init__.py rename to ya2/lib/p3d/__init__.py diff --git a/lib/lib/p3d/audio.py b/ya2/lib/p3d/audio.py similarity index 100% rename from lib/lib/p3d/audio.py rename to ya2/lib/p3d/audio.py diff --git a/lib/lib/p3d/gfx.py b/ya2/lib/p3d/gfx.py similarity index 99% rename from lib/lib/p3d/gfx.py rename to ya2/lib/p3d/gfx.py index 919af89..5a6a158 100755 --- a/lib/lib/p3d/gfx.py +++ b/ya2/lib/p3d/gfx.py @@ -8,7 +8,7 @@ from panda3d.core import get_model_path, AntialiasAttrib, PandaNode, \ Point3, Texture from direct.filter.CommonFilters import CommonFilters from direct.actor.Actor import Actor -from lib.lib.p3d.p3d import LibP3d +from ya2.lib.p3d.p3d import LibP3d def set_srgb(model): diff --git a/lib/lib/p3d/gui.py b/ya2/lib/p3d/gui.py similarity index 98% rename from lib/lib/p3d/gui.py rename to ya2/lib/p3d/gui.py index 1e702d2..80ef54d 100755 --- a/lib/lib/p3d/gui.py +++ b/ya2/lib/p3d/gui.py @@ -13,16 +13,16 @@ from direct.gui.DirectLabel import DirectLabel from direct.gui.DirectFrame import DirectFrame from direct.gui.OnscreenText import OnscreenText from direct.gui.DirectScrolledFrame import DirectScrolledFrame -from lib.observer import Subject -from lib.lib.ivals import Seq, Wait, PosIval, Func +from ya2.observer import Subject +from ya2.lib.ivals import Seq, Wait, PosIval, Func class CommonBase: def set_widget(self): - from lib.lib.gui import Frame, Slider, Btn, Label, OptionMenu, \ + from ya2.lib.gui import Frame, Slider, Btn, Label, OptionMenu, \ CheckBtn, Entry, Img, Text, ScrolledFrame - from lib.lib.p3d.widget import FrameMixin, SliderMixin, BtnMixin, \ + from ya2.lib.p3d.widget import FrameMixin, SliderMixin, BtnMixin, \ OptionMenuMixin, CheckBtnMixin, EntryMixin, ImgMixin, \ ScrolledFrameMixin self.__class__ = self.__class__ # for pylint diff --git a/lib/lib/p3d/ivals.py b/ya2/lib/p3d/ivals.py similarity index 100% rename from lib/lib/p3d/ivals.py rename to ya2/lib/p3d/ivals.py diff --git a/lib/lib/p3d/joystick.py b/ya2/lib/p3d/joystick.py similarity index 100% rename from lib/lib/p3d/joystick.py rename to ya2/lib/p3d/joystick.py diff --git a/lib/lib/p3d/p3d.py b/ya2/lib/p3d/p3d.py similarity index 100% rename from lib/lib/p3d/p3d.py rename to ya2/lib/p3d/p3d.py diff --git a/lib/lib/p3d/particle.py b/ya2/lib/p3d/particle.py similarity index 98% rename from lib/lib/p3d/particle.py rename to ya2/lib/p3d/particle.py index 51daec3..6884ef6 100755 --- a/lib/lib/p3d/particle.py +++ b/ya2/lib/p3d/particle.py @@ -6,9 +6,9 @@ from logging import info from panda3d.core import Geom, GeomVertexFormat, GeomVertexData, GeomPoints, \ OmniBoundingVolume, GeomNode, Vec3, ShaderAttrib, TexGenAttrib, \ TextureStage, Texture, GeomEnums, NodePath -from lib.lib.p3d.shader import load_shader -from lib.lib.p3d.gfx import P3dNode -from lib.gameobject import GameObject +from ya2.lib.p3d.shader import load_shader +from ya2.lib.p3d.gfx import P3dNode +from ya2.gameobject import GameObject class P3dParticle(GameObject): diff --git a/lib/lib/p3d/pause.py b/ya2/lib/p3d/pause.py similarity index 99% rename from lib/lib/p3d/pause.py rename to ya2/lib/p3d/pause.py index b99066e..3cbe4c6 100644 --- a/lib/lib/p3d/pause.py +++ b/ya2/lib/p3d/pause.py @@ -3,7 +3,7 @@ from os.path import dirname, abspath, join from sys import modules from direct.task import Task from direct.interval.IntervalGlobal import ivalMgr -from lib.gameobject import GameObject +from ya2.gameobject import GameObject class TaskDec: diff --git a/lib/lib/p3d/shader.py b/ya2/lib/p3d/shader.py similarity index 99% rename from lib/lib/p3d/shader.py rename to ya2/lib/p3d/shader.py index a054682..f19b224 100644 --- a/lib/lib/p3d/shader.py +++ b/ya2/lib/p3d/shader.py @@ -3,7 +3,7 @@ from panda3d.core import AmbientLight, DirectionalLight, PointLight, \ Spotlight, LVector4f, LVector3f, Vec3, Shader, TextureStage, \ TexMatrixAttrib from direct.filter.FilterManager import FilterManager -from lib.lib.builder import LibP3d +from ya2.lib.builder import LibP3d def load_shader(vert, frag): diff --git a/lib/lib/p3d/vec.py b/ya2/lib/p3d/vec.py similarity index 100% rename from lib/lib/p3d/vec.py rename to ya2/lib/p3d/vec.py diff --git a/lib/lib/p3d/widget.py b/ya2/lib/p3d/widget.py similarity index 99% rename from lib/lib/p3d/widget.py rename to ya2/lib/p3d/widget.py index c7a247c..42fc4f9 100755 --- a/lib/lib/p3d/widget.py +++ b/ya2/lib/p3d/widget.py @@ -1,6 +1,6 @@ from panda3d.core import LVecBase4f from direct.gui.DirectGuiGlobals import NORMAL, DISABLED -from lib.engine.vec import Vec2 +from ya2.engine.vec import Vec2 class WidgetMixin: diff --git a/lib/observer.py b/ya2/observer.py similarity index 100% rename from lib/observer.py rename to ya2/observer.py diff --git a/lib/tools/apply_gloss.py b/ya2/tools/apply_gloss.py similarity index 100% rename from lib/tools/apply_gloss.py rename to ya2/tools/apply_gloss.py diff --git a/lib/tools/build_metal_texture.py b/ya2/tools/build_metal_texture.py similarity index 100% rename from lib/tools/build_metal_texture.py rename to ya2/tools/build_metal_texture.py diff --git a/lib/tools/fix_mask_texture.py b/ya2/tools/fix_mask_texture.py similarity index 100% rename from lib/tools/fix_mask_texture.py rename to ya2/tools/fix_mask_texture.py diff --git a/lib/tools/kill_yorg.py b/ya2/tools/kill_yorg.py similarity index 100% rename from lib/tools/kill_yorg.py rename to ya2/tools/kill_yorg.py diff --git a/lib/tools/kill_yorg_server.py b/ya2/tools/kill_yorg_server.py similarity index 100% rename from lib/tools/kill_yorg_server.py rename to ya2/tools/kill_yorg_server.py diff --git a/lib/tools/pdfsingle.py b/ya2/tools/pdfsingle.py similarity index 90% rename from lib/tools/pdfsingle.py rename to ya2/tools/pdfsingle.py index 1ad7cf8..6d76361 100755 --- a/lib/tools/pdfsingle.py +++ b/ya2/tools/pdfsingle.py @@ -1,4 +1,4 @@ -# python lib/tools/pdfsingle.py path/to/file.py +# python ya2/tools/pdfsingle.py path/to/file.py from os import chdir, getcwd, system from os.path import dirname, basename, exists from sys import argv @@ -29,7 +29,7 @@ test_tmpl = "tail -n +1 {found} " + \ found = filename with InsideDir('tests/' + path): if exists('test_' + name): - found += ' lib/tests/%s/test_%s' % (path, name) + found += ' ya2/tests/%s/test_%s' % (path, name) test_cmd = test_tmpl.format(name=noext, found=found) system(test_cmd) #system('pdfnup --nup 2x1 -o {noext}.pdf {noext}.pdf'.format(noext=noext)) diff --git a/lib/tools/process_models.py b/ya2/tools/process_models.py similarity index 71% rename from lib/tools/process_models.py rename to ya2/tools/process_models.py index 97e3c28..3edd3f9 100644 --- a/lib/tools/process_models.py +++ b/ya2/tools/process_models.py @@ -1,4 +1,4 @@ -# usage: python lib/tools/process_models.py +# usage: python ya2/tools/process_models.py from os import system, walk from sys import executable @@ -7,4 +7,4 @@ for root, _, fnames in walk('assets/models'): for fname in [fname for fname in fnames if fname.endswith('.egg')]: _fname = root + '/' + fname system('egg-trans -nv 30 -o %s %s' % (_fname, _fname)) - system(executable + ' lib/tools/apply_gloss.py ' + _fname) + system(executable + ' ya2/tools/apply_gloss.py ' + _fname) diff --git a/lib/tools/set_diffuse.py b/ya2/tools/set_diffuse.py similarity index 100% rename from lib/tools/set_diffuse.py rename to ya2/tools/set_diffuse.py -- 2.30.2