mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 18:51:06 -03:30
Replace ansiconv with ansi2html (#15328)
* replace ansiconv with ansi2html The ansiconv package is archived so I'm replacing it with a similar package that's still actively being worked on. * remove minimum version The version minimum was used to get the latest version while running the upgrader * set minimum version for ansi2html * provide usage info
This commit is contained in:
@@ -48,8 +48,8 @@ from rest_framework import status
|
||||
from rest_framework_yaml.parsers import YAMLParser
|
||||
from rest_framework_yaml.renderers import YAMLRenderer
|
||||
|
||||
# ANSIConv
|
||||
import ansiconv
|
||||
# ansi2html
|
||||
from ansi2html import Ansi2HTMLConverter
|
||||
|
||||
# Python Social Auth
|
||||
from social_core.backends.utils import load_backends
|
||||
@@ -4205,7 +4205,8 @@ class UnifiedJobStdout(RetrieveAPIView):
|
||||
# Remove any ANSI escape sequences containing job event data.
|
||||
content = re.sub(r'\x1b\[K(?:[A-Za-z0-9+/=]+\x1b\[\d+D)+\x1b\[K', '', content)
|
||||
|
||||
body = ansiconv.to_html(html.escape(content))
|
||||
conv = Ansi2HTMLConverter()
|
||||
body = conv.convert(html.escape(content))
|
||||
|
||||
context = {'title': get_view_name(self.__class__), 'body': mark_safe(body), 'dark': dark_bg, 'content_only': content_only}
|
||||
data = render_to_string('api/stdout.html', context).strip()
|
||||
|
||||
Reference in New Issue
Block a user