mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-19 04:33:26 +02:00
Missing weapons now raise a warning, and recursive directory parsing.
In order to avoid parsing arbitrary python files encountered during directory recursion, ``makesheets`` now checks each python file for a string listing the *dungeonsheets_version* before trying to import the character file.
This commit is contained in:
@@ -155,13 +155,9 @@ class JSONCharacterReader(BaseCharacterReader):
|
||||
match = item_re.match(obj['name'])
|
||||
if match:
|
||||
weapon_name = self.get_attrib(match.group()).lower()
|
||||
if weapon_name[:3] == "i. ":
|
||||
# Ignore artificer infusions
|
||||
warnings.warn("Ignoring weapon infusion")
|
||||
else:
|
||||
weapon_name = weapon_name.split('(')[0].strip()
|
||||
weapon_name = weapon_name.split(',')[0].strip()
|
||||
yield weapon_name
|
||||
weapon_name = weapon_name.split('(')[0].strip()
|
||||
weapon_name = weapon_name.split(',')[0].strip()
|
||||
yield weapon_name
|
||||
|
||||
def __call__(self, filename: str):
|
||||
"""Create a character property dictionary from the JSON file."""
|
||||
|
||||
Reference in New Issue
Block a user