Skip to content

Commit d1938bc

Browse files
committed
add deprecation warning for hooks devs
1 parent 50ed487 commit d1938bc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Data.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import logging
22

33
from .DataValidation import DataValidation, ValidationError
4-
from .Helpers import load_data_file
4+
from .Helpers import load_data_file as helpers_load_data_file
55

66
from .hooks.Data import \
77
after_load_game_file, \
88
after_load_item_file, after_load_location_file, \
99
after_load_region_file, after_load_category_file, \
1010
after_load_meta_file
1111

12-
12+
# blatantly copied from the minecraft ap world because why not
13+
def load_data_file(*args) -> dict:
14+
logging.warning("Deprecated usage of importing load_data_file from Data.py uses the one from Helper.py instead")
15+
return helpers_load_data_file(*args)
1316

1417
def convert_to_list(data, property_name: str) -> list:
1518
if isinstance(data, dict):
@@ -26,7 +29,7 @@ def __init__(self, filename, data_type):
2629
self.data_type = data_type
2730

2831
def load(self):
29-
contents = load_data_file(self.filename)
32+
contents = helpers_load_data_file(self.filename)
3033

3134
if not contents and type(contents) != self.data_type:
3235
return self.data_type()

0 commit comments

Comments
 (0)