Mercurial > libervia-backend
comparison frontends/src/jp/constants.py @ 2232:4f389486667d
jp: added constant to handle ANSI code for header and subheaders
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 27 Apr 2017 00:57:04 +0200 |
parents | d823a0cdbcc2 |
children | bf998d8626d9 |
comparison
equal
deleted
inserted
replaced
2231:230fc5b609a8 | 2232:4f389486667d |
---|---|
16 | 16 |
17 # You should have received a copy of the GNU Affero General Public License | 17 # You should have received a copy of the GNU Affero General Public License |
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 |
20 from sat_frontends.quick_frontend import constants | 20 from sat_frontends.quick_frontend import constants |
21 from sat.tools.common.ansi import ANSI as A | |
21 | 22 |
22 | 23 |
23 class Const(constants.Const): | 24 class Const(constants.Const): |
24 | 25 |
25 APP_NAME = u"jp" | 26 APP_NAME = u"jp" |
31 OUTPUT_COMPLEX = u'complex' # complex data (e.g. multi-level dictionary) | 32 OUTPUT_COMPLEX = u'complex' # complex data (e.g. multi-level dictionary) |
32 OUTPUT_XML = u'xml' # XML node (as unicode string) | 33 OUTPUT_XML = u'xml' # XML node (as unicode string) |
33 OUTPUT_LIST_XML = u'list_xml' # list of XML nodes (as unicode strings) | 34 OUTPUT_LIST_XML = u'list_xml' # list of XML nodes (as unicode strings) |
34 OUTPUT_TYPES = (OUTPUT_TEXT, OUTPUT_DICT, OUTPUT_LIST, OUTPUT_COMPLEX, OUTPUT_XML, OUTPUT_LIST_XML) | 35 OUTPUT_TYPES = (OUTPUT_TEXT, OUTPUT_DICT, OUTPUT_LIST, OUTPUT_COMPLEX, OUTPUT_XML, OUTPUT_LIST_XML) |
35 | 36 |
37 # ANSI | |
38 A_HEADER = A.BOLD + A.FG_YELLOW | |
39 A_SUBHEADER = A.BOLD + A.FG_RED | |
40 | |
36 # exit codes | 41 # exit codes |
37 EXIT_OK = 0 | 42 EXIT_OK = 0 |
38 EXIT_ERROR = 1 # generic error, when nothing else match | 43 EXIT_ERROR = 1 # generic error, when nothing else match |
39 EXIT_BAD_ARG = 2 # arguments given by user are bad | 44 EXIT_BAD_ARG = 2 # arguments given by user are bad |
40 EXIT_BRIDGE_ERROR = 3 # can't connect to bridge | 45 EXIT_BRIDGE_ERROR = 3 # can't connect to bridge |