def toastentry(cls, toaster): arg = toaster.options["arg"] if not arg: # missing arg toaster.logger.warn( "must specify regular expression and substitution as argument " "(e.g. -a /Bip01/Bip02) to apply spell") return False dummy, toaster.regex, toaster.sub = arg.split(arg[0]) toaster.sub = _as_bytes(toaster.sub) toaster.regex = re.compile(_as_bytes(toaster.regex)) return True
def substitute(self, old_path): if (_as_bytes('\\lowres\\') not in old_path.lower()): return SpellSubstituteTexturePath.substitute(self, old_path) else: return old_path
def toastentry(cls, toaster): toaster.sub = _as_bytes("textures\\\\lowres\\\\") toaster.regex = re.compile(_as_bytes("^textures\\\\"), re.IGNORECASE) return True