Skip to content

Commit

Permalink
Fixed error in Windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Brachi committed Mar 23, 2016
1 parent ef6ff77 commit 4fae2d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions albam/mtframework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'ev616_00.arc',
'ev617_00.arc',
'ev618_00.arc',
'uOm09882.arc',
's109.arc',
's119.arc',
's300.arc',
Expand Down
4 changes: 2 additions & 2 deletions albam/mtframework/arc.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')

0 comments on commit 4fae2d4

Please sign in to comment.