Mercurial > libervia-backend
diff sat_frontends/jp/output_xml.py @ 3640:f4c02bdb2d91
CLI: use global constants for output names
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 08 Sep 2021 11:13:35 +0200 |
parents | be6d91572633 |
children | 4b842c1fb686 |
line wrap: on
line diff
--- a/sat_frontends/jp/output_xml.py Wed Sep 01 13:46:43 2021 +0200 +++ b/sat_frontends/jp/output_xml.py Wed Sep 08 11:13:35 2021 +0200 @@ -1,7 +1,6 @@ #! /usr/bin/env python3 - -# jp: a SàT command line tool +# Libervia CLI frontend # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify @@ -36,8 +35,6 @@ __outputs__ = ["XML"] -RAW = "xml_raw" -PRETTY = "xml_pretty" class XML(object): @@ -45,16 +42,20 @@ def __init__(self, host): self.host = host - host.register_output(C.OUTPUT_XML, PRETTY, self.pretty, default=True) - host.register_output(C.OUTPUT_LIST_XML, PRETTY, self.pretty_list, default=True) - host.register_output(C.OUTPUT_XML, RAW, self.raw) - host.register_output(C.OUTPUT_LIST_XML, RAW, self.list_raw) + host.register_output(C.OUTPUT_XML, C.OUTPUT_NAME_XML, self.pretty, default=True) + host.register_output( + C.OUTPUT_LIST_XML, C.OUTPUT_NAME_XML, self.pretty_list, default=True + ) + host.register_output(C.OUTPUT_XML, C.OUTPUT_NAME_XML_RAW, self.raw) + host.register_output(C.OUTPUT_LIST_XML, C.OUTPUT_NAME_XML_RAW, self.list_raw) def colorize(self, xml): if pygments is None: self.host.disp( _( - "Pygments is not available, syntax highlighting is not possible. Please install if from http://pygments.org or with pip install pygments" + "Pygments is not available, syntax highlighting is not possible. " + "Please install if from http://pygments.org or with pip install " + "pygments" ), error=True, )