From 4fae2d490a89399e14e85259a5faf28cf02e4a87 Mon Sep 17 00:00:00 2001 From: Sebastian Brachi Date: Wed, 23 Mar 2016 20:59:40 -0300 Subject: [PATCH] Fixed error in Windows paths --- albam/mtframework/__init__.py | 1 + albam/mtframework/arc.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/albam/mtframework/__init__.py b/albam/mtframework/__init__.py index 3842e3a1..65ff044c 100644 --- a/albam/mtframework/__init__.py +++ b/albam/mtframework/__init__.py @@ -27,6 +27,7 @@ 'ev616_00.arc', 'ev617_00.arc', 'ev618_00.arc', + 'uOm09882.arc', 's109.arc', 's119.arc', 's300.arc', diff --git a/albam/mtframework/arc.py b/albam/mtframework/arc.py index 1556a1d5..1ec933a4 100644 --- a/albam/mtframework/arc.py +++ b/albam/mtframework/arc.py @@ -1,7 +1,6 @@ from ctypes import Structure, sizeof, c_int, c_uint, c_char, c_short, c_ubyte import ntpath import os -import re import zlib from albam.mtframework.mappers import FILE_ID_TO_EXTENSION, EXTENSION_TO_FILE_ID @@ -99,7 +98,8 @@ def _get_path(file_path, file_type_id, output_path): @staticmethod def _set_path(source_path, file_path): - file_path = re.sub(source_path + os.path.sep, '', file_path, count=1) + source_path = source_path + os.path.sep if not source_path.endswith(os.path.sep) else source_path + file_path = file_path.replace(source_path, '') file_path = os.path.splitext(file_path)[0] parts = file_path.split(os.path.sep) return ntpath.join('', *parts).encode('ascii')