Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_report_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import report_paths # noqa: E402

# Tools that use report_paths and must not define their own copy again.
SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs",
"glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index",
"world_lights_paths", "world_names")
SHARED = ("anim_clips", "anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml",
"gen_d3d12_stubs", "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe",
"world_index", "world_lights_paths", "world_names")
# The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list:
# import report_paths instead.
LEGACY_COPIES = {"navmesh_decode"}
Expand Down
10 changes: 2 additions & 8 deletions tools/anim_clips.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from file_mode import published_mode # noqa: E402
from pool_workers import process_workers # noqa: E402
from replace_retry import replace as replace_retry # noqa: E402
from report_paths import same_report_path # noqa: E402

SYSTEM = 0x50000000
CHANNEL_NAMES = ("static_quat", "static_vec3", "static_float", "raw_float", "quantize_float",
Expand Down Expand Up @@ -1522,14 +1523,7 @@ def decode_one(path, offset, frames):
return d


def same_output_path(first, second):
"""True when writing ``second`` would truncate ``first`` (same file, path or hard link)."""
if os.path.normcase(os.path.realpath(first)) == os.path.normcase(os.path.realpath(second)):
return True
try:
return os.path.samefile(first, second)
except OSError:
return False
same_output_path = same_report_path # True when writing the second would truncate the first


def main():
Expand Down