def findCachedName(self, source, target, isCached): sum = Text.hash(source,12) if isCached else '000000000000' if target == '': return os.path.join( FileLoader.dirCache , 'file_{0}.bin'.format(sum) ) if target.startswith('@'): return target[1:] extIndex = target.rfind('.') if extIndex != -1: return os.path.join( FileLoader.dirCache , u'{0}_{1}{2}'.format(target[:extIndex],sum,target[extIndex:]) ) return os.path.join( FileLoader.dirCache , '{0}_{1}{2}'.format(target, sum,'.bin') )