Bug Fix (Windows)

* Replaced os.path.join with posixpath.join in some instances to enforce UNIX paths
This commit is contained in:
LoafyLemon 2023-02-11 21:25:15 +00:00
parent fb8e3aab0f
commit 7d1e761308
8 changed files with 13 additions and 13 deletions

View File

@ -20,7 +20,7 @@ init 1 python:
@functools.cache @functools.cache
def get_layers(self, hash): def get_layers(self, hash):
path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "bodyparts", self.type, self.id) path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "bodyparts", self.type, self.id)
extensions = self.extensions extensions = self.extensions
types = self.layer_types types = self.layer_types

View File

@ -58,7 +58,7 @@ init python:
@functools.cache @functools.cache
def get_layers(self, hash): def get_layers(self, hash):
path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id)
extensions = self.extensions extensions = self.extensions
types = self.layer_types types = self.layer_types

View File

@ -34,7 +34,7 @@ init python:
@functools.cache @functools.cache
def get_layers(self, hash, _ignore_equipped=False): def get_layers(self, hash, _ignore_equipped=False):
path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id) path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id)
_tracking = self._tracking _tracking = self._tracking
def _negative_lookahead(): def _negative_lookahead():
@ -43,7 +43,7 @@ init python:
def _lookahead(path): def _lookahead(path):
tracking_object = self.tracking_object tracking_object = self.tracking_object
tracking_id = tracking_object.id if tracking_object else None tracking_id = tracking_object.id if tracking_object else None
path = os.path.join(path, tracking_id) path = posixpath.join(path, tracking_id)
if not any(fp.startswith(path) for fp in renpy.list_files()): if not any(fp.startswith(path) for fp in renpy.list_files()):
return "default" return "default"
@ -102,7 +102,7 @@ init python:
print(f"Invalid tracker for object: {self}") print(f"Invalid tracker for object: {self}")
return {} return {}
path = os.path.join(path, tracking_id) path = posixpath.join(path, tracking_id)
extensions = self.extensions extensions = self.extensions
types = self.layer_types types = self.layer_types

View File

@ -53,14 +53,14 @@ init python:
if part in face_layers: if part in face_layers:
zorder = face_layers.get(part) zorder = face_layers.get(part)
identifier = active_faces.get(part, "default") identifier = active_faces.get(part, "default")
path = os.path.join(self.char.modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) path = posixpath.join(self.char.modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier)
else: else:
cloth, zorder, is_worn = active_clothes.get(part, [None, None, None]) cloth, zorder, is_worn = active_clothes.get(part, [None, None, None])
if is_worn is None: if is_worn is None:
# Backwards compatibility for old layering system # Backwards compatibility for old layering system
path = os.path.join("characters", self.char.name, self.char.pose, "cum", part, name) path = posixpath.join("characters", self.char.name, self.char.pose, "cum", part, name)
if config.developer: if config.developer:
renpy.notify(f"Using old-type cum layer, consider updating the code; Layer: \"{part}\"") renpy.notify(f"Using old-type cum layer, consider updating the code; Layer: \"{part}\"")
@ -74,8 +74,8 @@ init python:
modpath = cloth.modpath modpath = cloth.modpath
zorder = cloth.zorder + 1 zorder = cloth.zorder + 1
path = os.path.join(modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier) path = posixpath.join(modpath, "characters", self.char.name, self.char.pose, "cum", part, name, identifier)
path = path if _lookahead(path) else os.path.join(os.path.split(path)[0], (identifier := "default")) path = path if _lookahead(path) else posixpath.join(os.path.split(path)[0], (identifier := "default"))
for f in renpy.list_files(): for f in renpy.list_files():
fp, fn = os.path.split(f) fp, fn = os.path.split(f)

View File

@ -41,7 +41,7 @@ init python:
if name is None: if name is None:
continue continue
path = os.path.join(self.char.modpath, "characters", self.char.name, self.char.pose, "face", part, name) path = posixpath.join(self.char.modpath, "characters", self.char.name, self.char.pose, "face", part, name)
for f in renpy.list_files(): for f in renpy.list_files():
fp, fn = os.path.split(f) fp, fn = os.path.split(f)

View File

@ -467,7 +467,7 @@ init python:
self.show() self.show()
def set_pose(self, pose): def set_pose(self, pose):
pose = "" if pose is None else os.path.join("poses", pose) pose = "" if pose is None else posixpath.join("poses", pose)
self.pose = pose self.pose = pose
self.body.is_stale() self.body.is_stale()
self.face.is_stale() self.face.is_stale()

View File

@ -20,7 +20,7 @@ init python:
print(f"Invalid tracker for object: {self}") print(f"Invalid tracker for object: {self}")
return [] return []
path = os.path.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id, tracking) path = posixpath.join(self.modpath, "characters", self.name, self.char.pose, "clothes", self.type, self.id, tracking)
extensions = self.extensions extensions = self.extensions
types = self.layer_types types = self.layer_types

View File

@ -24,7 +24,7 @@ init python in studio:
for part in charobj.face._face.keys(): for part in charobj.face._face.keys():
path = os.path.join("characters", charname, charobj.pose, "face", part) path = posixpath.join("characters", charname, charobj.pose, "face", part)
for f in renpy.list_files(): for f in renpy.list_files():
fp, fn = os.path.split(f) fp, fn = os.path.split(f)