Skip to content

Commit

Permalink
Try to handle escaped windows style slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
joepal1976 committed May 13, 2021
1 parent 0a4a1b8 commit 86bde3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mpfb/entities/material/makeskinmaterial.py
Expand Up @@ -33,7 +33,9 @@ def _template(self, template_values, has, tex, key):
template_values[has] = "false"
template_values[tex] = "\"\""
if key in self._settings and self._settings[key]:
_LOG.debug(key + " is set in mhmat")
_LOG.debug(key + " is set in mhmat", self._settings[key])
self._settings[key] = str(self._settings[key]).replace("\\\\", "/")
self._settings[key] = str(self._settings[key]).replace("\\", "/")
template_values[has] = "true"
template_values[tex] = "\"" + self._settings[key] + "\""
else:
Expand Down
2 changes: 2 additions & 0 deletions src/mpfb/entities/material/mhmatkeytypes.py
Expand Up @@ -69,6 +69,8 @@ def parse_file(self, input_line, location):
# TODO: handle case where location is absolute. We cannot use basename since the path
# TODO: continues into the structure of the file
value = location + "/" + value
value = value.replace("\\\\", "/") # Try to avoid windows style slashes
value = value.replace("\\", "/")
return self.key_name, value


Expand Down

0 comments on commit 86bde3e

Please sign in to comment.