def hfs_to_posix_path(hfs_path): """ Turns an HFS path (Macintosh HD:Path:file.ext) into a posix path (/Path/file.ext) """ url = mactypes.convertpathtourl(hfs_path, 1) # kCFURLHFSPathStyle = 1 return mactypes.converturltopath(url, 0) # kCFURLPOSIXPathStyle = 0
def get_fullname(xl_workbook): hfs_path = xl_workbook.properties().get(kw.full_name) if hfs_path == xl_workbook.properties().get(kw.name): return hfs_path url = mactypes.convertpathtourl(hfs_path, 1) # kCFURLHFSPathStyle = 1 return mactypes.converturltopath(url, 0) # kCFURLPOSIXPathStyle = 0