Skip to content

Commit

Permalink
Add deprecation notice for Resource.flush_to_disk
Browse files Browse the repository at this point in the history
  • Loading branch information
whyitfor committed Jan 10, 2025
1 parent d6f10cb commit aef6b9a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ofrak_core/ofrak/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
overload,
)
from contextlib import asynccontextmanager
from warnings import warn

import tempfile312 as tempfile

from ofrak.component.interface import ComponentInterface
Expand Down Expand Up @@ -1451,6 +1453,13 @@ async def flush_data_to_disk(self, path: str, pack: bool = True):
with open(path, "wb") as f:
pass

async def flush_to_disk(self, path: str, pack: bool = True): # pragma: no cover
warn(
"Resource.flush_to_disk is deprecated! Use Resource.flush_data_to_disk instead.",
category=DeprecationWarning,
)
return await self.flush_data_to_disk(path, pack)

def __repr__(self):
properties = [
f"resource_id={self._resource.id.hex()}",
Expand Down

0 comments on commit aef6b9a

Please sign in to comment.