L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
119 stars 22 forks source link

Cannot find saves with glob special characters in name #77

Closed PyroMyst closed 4 years ago

PyroMyst commented 4 years ago

Lines 430 and 431 in auto.py return no results if the saveName has glob special characters in it (for instance '[' or ']').

I replaced the lines with the following to get it working with square brackets in the interim. There may be a better solution (especially one that handle other special characters), but I have not done anything in python before today.

        safeSaveName = saveName.replace('[', '{(}').replace(']', '{)}').replace('{(}', '[[]').replace('{)}', '[]]')
        globResults = list(saves.glob(safeSaveName))
        globResults = list(saves.glob(f"{safeSaveName}.zip"))