def run(self, xline, lineno, match): pywmlx.state.machine._currentdomain = match.group(3) xline = None if match.group(1) is None and pywmlx.state.machine._warnall: finfo = pywmlx.nodemanip.fileref + ":" + str(lineno) wmlwarn(finfo, "function '_', in lua code, should be local.") return (xline, 'lua_idle')
def checksentence(mystring, finfo, *, islua=False): m = re.match(r"\s*$", mystring) if m: wmlwarn(finfo, "found an empty translatable message") return 1 elif warnall() and not islua: if "}" in mystring: wmsg = "found a translatable string containing a WML macro. " " Translation for this string will NEVER work" wmlwarn(finfo, wmsg) return 2 else: return 0 else: return 0
def checksentence(mystring, finfo, *, islua=False): m = re.match(r'\s*$', mystring) if m: wmlwarn(finfo, "found an empty translatable message") return 1 elif warnall() and not islua: if "}" in mystring: wmsg = ("found a translatable string containing a WML macro. " " Translation for this string will NEVER work") wmlwarn(finfo, wmsg) return 2 else: return 0 else: return 0