@@ -24,7 +24,12 @@ class ReforgerConfigGenerator:
24
24
"""Manages Arma Reforger config.json for variations of modlist/scenario"""
25
25
26
26
def __init__ (self , base_config_file : Path , target_folder : Path ):
27
- """Instantiate a config generator with the base config to use"""
27
+ """Instantiate a config generator with the base config to use
28
+
29
+ Args:
30
+ base_config_file: The filename of a reference Reforger config
31
+ target_folder: The folder to place generated config files in
32
+ """
28
33
self .base_config = base_config_file
29
34
self .target_dest = target_folder
30
35
@@ -109,6 +114,10 @@ def current_mission(self) -> str:
109
114
110
115
Returns:
111
116
Currently active mission name
117
+
118
+ Raises:
119
+ ConfigFileNotFound: Mission symlink was found but points to a
120
+ non-existent mission.
112
121
"""
113
122
symlink_path = self .target_dest / SYMLINK_FILENAME
114
123
target = symlink_path .readlink ()
@@ -145,7 +154,20 @@ def patch_file(source: dict, modlist: list[ModDetail] | None, scenario_id: str)
145
154
146
155
147
156
def extract_mods (modlist : str | None ) -> list [ModDetail ] | None :
148
- """Extracts a list of ModDetail entries from a mod list exported from Reforger."""
157
+ """Extracts a list of ModDetail entries from a mod list exported from Reforger
158
+
159
+ Args:
160
+ modlist: A partial JSON string of mods to extract. Can be None if the
161
+ user did not provide any mods, in which case the operation is a
162
+ no-op.
163
+
164
+ Raises:
165
+ pydantic.ValidationError: Generic error in validating the mod list
166
+ ConfigFileInvalidJson: The input was not valid JSON
167
+
168
+ Returns:
169
+ A list of ModDetail, or None if the input was None.
170
+ """
149
171
if modlist is None :
150
172
return None
151
173
modlist = f"[{ modlist } ]"
0 commit comments