From 8996bb9d043eb23c5ffa2fffcd35c8c22d232ff2 Mon Sep 17 00:00:00 2001 From: Martinez Date: Fri, 7 Oct 2016 15:30:22 +0200 Subject: [PATCH] added a list of colors to ---help --- over/docs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/over/docs.py b/over/docs.py index 8d8112a..5009ea9 100644 --- a/over/docs.py +++ b/over/docs.py @@ -2,6 +2,7 @@ # encoding: utf-8 from collections import OrderedDict +from .text import ansi_colors over_docs = OrderedDict() over_docs["What"] = ["over<.> is a Python 3 library that attempts to provide essential and convenient application functionality. Configuration, command line parsing, text handling and output, a non-interactive help system, human-readable exception processing, subprocess execution and many more are available."] @@ -18,6 +19,17 @@ over_docs["Options"] = [ over_docs["Configuration sources"] = ["Each option can take its state either from (in order) the application default value, the config file, or the command line. Combining multiple sources (e.g. extending values in the config file with the command line) is not permitted - a new source always resets the option's state. It is possible for an option to have no value."] over_docs["Config File"] = ["If enabled by the application, a config file will be generated when first executed. The config file will be populated with all known options, their descriptions and some instructions on how to proceed. If a newer version of the application that offers more configurable options is executed, the config file will be automatically updated."] +colors = [] + +for code, (_, name) in ansi_colors.items(): + c = "<<%s><.>: <%s>%s<.>" %(code, code, name) + + if code == "k": + c += ' (this one says "black")' + + colors.append(c) + +over_docs["Available Colors"] = colors config_file_header = """# Configuration file for %s-%s # Generated by over-%s