mirror of
				https://github.com/KoboldAI/KoboldAI-Client.git
				synced 2025-06-05 21:59:24 +02:00 
			
		
		
		
	Remove escape characters from all error messages
This commit is contained in:
		
							
								
								
									
										16
									
								
								aiserver.py
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								aiserver.py
									
									
									
									
									
								
							@@ -997,7 +997,7 @@ def load_lua_scripts():
 | 
			
		||||
        if(vars.serverstarted):
 | 
			
		||||
            emit('from_server', {'cmd': 'errmsg', 'data': 'Lua script error, please check console.'}, broadcast=True)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.YELLOW, "Lua engine stopped; please open 'Userscripts' and press Load to reinitialize scripts.", colors.END), file=sys.stderr)
 | 
			
		||||
        if(vars.serverstarted):
 | 
			
		||||
            set_aibusy(0)
 | 
			
		||||
@@ -1298,7 +1298,7 @@ def execute_inmod():
 | 
			
		||||
        vars.lua_koboldbridge.obliterate_multiverse()
 | 
			
		||||
        emit('from_server', {'cmd': 'errmsg', 'data': 'Lua script error, please check console.'}, broadcast=True)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.YELLOW, "Lua engine stopped; please open 'Userscripts' and press Load to reinitialize scripts.", colors.END), file=sys.stderr)
 | 
			
		||||
        set_aibusy(0)
 | 
			
		||||
 | 
			
		||||
@@ -1312,7 +1312,7 @@ def execute_outmod():
 | 
			
		||||
        vars.lua_koboldbridge.obliterate_multiverse()
 | 
			
		||||
        emit('from_server', {'cmd': 'errmsg', 'data': 'Lua script error, please check console.'}, broadcast=True)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.YELLOW, "Lua engine stopped; please open 'Userscripts' and press Load to reinitialize scripts.", colors.END), file=sys.stderr)
 | 
			
		||||
        set_aibusy(0)
 | 
			
		||||
 | 
			
		||||
@@ -1364,7 +1364,7 @@ except lupa.LuaError as e:
 | 
			
		||||
    print(colors.RED + "ERROR!" + colors.END)
 | 
			
		||||
    vars.lua_koboldbridge.obliterate_multiverse()
 | 
			
		||||
    print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
    print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
    print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
    exit(1)
 | 
			
		||||
print(colors.GREEN + "OK!" + colors.END)
 | 
			
		||||
 | 
			
		||||
@@ -2256,11 +2256,11 @@ def generate(txt, minimum, maximum, found_entries=None):
 | 
			
		||||
            vars.lua_koboldbridge.obliterate_multiverse()
 | 
			
		||||
            emit('from_server', {'cmd': 'errmsg', 'data': 'Lua script error, please check console.'}, broadcast=True)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.YELLOW, "Lua engine stopped; please open 'Userscripts' and press Load to reinitialize scripts.", colors.END), file=sys.stderr)
 | 
			
		||||
        else:
 | 
			
		||||
            emit('from_server', {'cmd': 'errmsg', 'data': 'Error occured during generator call, please check console.'}, broadcast=True)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
        set_aibusy(0)
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
@@ -2466,11 +2466,11 @@ def tpumtjgenerate(txt, minimum, maximum, found_entries=None):
 | 
			
		||||
            vars.lua_koboldbridge.obliterate_multiverse()
 | 
			
		||||
            emit('from_server', {'cmd': 'errmsg', 'data': 'Lua script error, please check console.'}, broadcast=True)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, "***LUA ERROR***: ", colors.END), end="", file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
            print("{0}{1}{2}".format(colors.YELLOW, "Lua engine stopped; please open 'Userscripts' and press Load to reinitialize scripts.", colors.END), file=sys.stderr)
 | 
			
		||||
        else:
 | 
			
		||||
            emit('from_server', {'cmd': 'errmsg', 'data': 'Error occured during generator call, please check console.'}, broadcast=True)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, e, colors.END), file=sys.stderr)
 | 
			
		||||
        print("{0}{1}{2}".format(colors.RED, str(e).replace("\033", ""), colors.END), file=sys.stderr)
 | 
			
		||||
        set_aibusy(0)
 | 
			
		||||
        return
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user