mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	migration_status: Update ANSI code clean up regex.
in `get_migrations_status`, we clean up the printed output of any ANSI codes used to format the output. Currently the regex only cleans up bold ANSI escape code (\x1b[1m) and style reset code (\x1b[0m). So it won't be able to clean up basic ANSI escape codes such as "\x1b\31;1m" which is used to format `showmigrations` output for apps with no migrations. e.g, "\x1b\31;1m (no migrations)" This commit updates the regex to catch a wider range of basic ANSI codes.
This commit is contained in:
		@@ -37,4 +37,4 @@ def get_migration_status(**options: Any) -> str:
 | 
			
		||||
    )
 | 
			
		||||
    out.seek(0)
 | 
			
		||||
    output = out.read()
 | 
			
		||||
    return re.sub(r"\x1b\[(1|0)m", "", output)
 | 
			
		||||
    return re.sub(r"\x1b\[[0-9;]*m", "", output)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user