GandaG / pyfomod

A high-level fomod library written in Python.

Home Page:https://pyfomod.rtfd.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for case-sensitive systems to parse from a folder

OlavStornes opened this issue · comments

Hi! Stumbled upon this package when i was scouting for some inspiration on parsers for fomod.

When attempting to parse a package with the first option, pyfomod assumes that the filename is moduleconfig.xml, which works fine in a case-insensitive file-system. However, when doing the same in a case-sensitive file-system (such as a file-system often used in linux), this fails.

Example

>>> x = pyfomod.parse(".")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/{REDACTED}/.local/lib/python3.10/site-packages/pyfomod/parser.py", line 272, in parse
    raise FileNotFoundError(
FileNotFoundError: [Errno 2] No such file or directory: 'moduleconfig.xml'
>>> x = pyfomod.parse(("./fomod/info.xml", "./fomod/ModuleConfig.xml"))
>>> x
<pyfomod.fomod.Root object at 0x7f12de46f880>
>>> 

Appreciate your response. I agree that this shouldn't be a big priority, especially if it's main usage is on windows.

Cheers!