Skip to content

Commit

Permalink
updated import
Browse files Browse the repository at this point in the history
  • Loading branch information
pnxenopoulos committed Jan 14, 2025
1 parent 28c4d45 commit 8417b6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions awpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from awpy import Demo, Nav, Spawns
from awpy.data import AWPY_DATA_DIR, TRI_URL
from awpy.vis import VphysParser
from awpy.visibility import VphysParser


@click.group()
Expand All @@ -21,10 +21,10 @@ def awpy() -> None:

@awpy.command(
help="""
Get Counter-Strike 2 resources like map images, nav meshes or usd files. \n
Get Counter-Strike 2 resources like parsed nav meshes, spawns or triangle files. \n
Available choices: 'tri', 'map', 'nav', 'spawn'"""
)
@click.argument("resource_type", type=click.Choice(["tri"]))
@click.argument("resource_type", type=click.Choice(["tri", "nav", "spawn"]))
def get(resource_type: Literal["tri"]) -> None:
"""Get a resource given its type and name."""
if not AWPY_DATA_DIR.exists():
Expand Down Expand Up @@ -59,30 +59,32 @@ def get(resource_type: Literal["tri"]) -> None:
# Delete the zip file
tri_file_path.unlink()
logger.info(f"Deleted the compressed tris {tri_file_path}")
elif resource_type == "map":
map_not_impl_msg = "Map files are not yet implemented."
raise NotImplementedError(map_not_impl_msg)
elif resource_type == "spawn":
spawn_not_impl_msg = "Spawn files are not yet implemented."
raise NotImplementedError(spawn_not_impl_msg)
elif resource_type == "nav":
nav_not_impl_msg = "Nav files are not yet implemented."
raise NotImplementedError(nav_not_impl_msg)


@awpy.command(help="Parse a Counter-Strike 2 demo (.dem) file .")
@awpy.command(help="Parse a Counter-Strike 2 demo (.dem) file.")
@click.argument("demo", type=click.Path(exists=True))
@click.option("--outpath", type=click.Path(), help="Path to save the compressed demo.")
@click.option(
"--outpath", type=click.Path(), help="Path to save compressed (.zip) parsed demo."
)
@click.option("--verbose", is_flag=True, default=False, help="Enable verbose mode.")
@click.option("--noticks", is_flag=True, default=False, help="Disable tick parsing.")
@click.option(
"--norounds",
is_flag=True,
default=False,
help="Get round information for every event.",
help="Finds in which round events occur.",
)
@click.option(
"--player-props", multiple=True, help="List of player properties to include."
"--player-props", multiple=True, help="Comma-separated list of player properties."
)
@click.option(
"--other-props", multiple=True, help="List of other properties to include."
"--other-props", multiple=True, help="Comma-separated list of other properties."
)
def parse_demo(
demo: Path,
Expand Down Expand Up @@ -122,7 +124,7 @@ def parse_spawns(vent_file: Path, *, outpath: Optional[Path] = None) -> None:
)


@awpy.command(help="Parse a Counter-Strike 2 nav (.nav) file.")
@awpy.command(help="Parse a Counter-Strike 2 .nav file.")
@click.argument("nav_file", type=click.Path(exists=True))
@click.option("--outpath", type=click.Path(), help="Path to save the compressed demo.")
def parse_nav(nav_file: Path, *, outpath: Optional[Path] = None) -> None:
Expand Down
2 changes: 1 addition & 1 deletion awpy/vector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Simple Vector3 representation."""
"""Simple Vector3 representation to represent 3D points."""

from __future__ import annotations # Enables postponed evaluation of type hints

Expand Down

0 comments on commit 8417b6c

Please sign in to comment.