diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-11-13 11:50:34 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-11-25 17:51:13 +0100 |
commit | ebbe63562c9436cefd72d776b898d91960286b04 (patch) | |
tree | 8cf78880a70f9c0b39a339d8ad30ecd8b5b81fa1 | |
parent | 48c48c9e4d4200a4e50b25bcab95ce947c1dd932 (diff) | |
download | git-buildpackage-ebbe63562c9436cefd72d776b898d91960286b04.tar.gz git-buildpackage-ebbe63562c9436cefd72d776b898d91960286b04.tar.bz2 git-buildpackage-ebbe63562c9436cefd72d776b898d91960286b04.zip |
New configuration option for setting the output color scheme
Adds a new command line and config file option 'color-scheme' for
selecting the colors used in log output.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | gbp/config.py | 6 | ||||
-rwxr-xr-x | gbp/scripts/buildpackage.py | 4 | ||||
-rwxr-xr-x | gbp/scripts/clone.py | 4 | ||||
-rw-r--r-- | gbp/scripts/create_remote_repo.py | 4 | ||||
-rw-r--r-- | gbp/scripts/dch.py | 4 | ||||
-rw-r--r-- | gbp/scripts/import_dsc.py | 3 | ||||
-rw-r--r-- | gbp/scripts/import_orig.py | 4 | ||||
-rwxr-xr-x | gbp/scripts/pq.py | 4 | ||||
-rwxr-xr-x | gbp/scripts/pull.py | 4 |
9 files changed, 30 insertions, 7 deletions
diff --git a/gbp/config.py b/gbp/config.py index 7f269d40..cec593b6 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -113,6 +113,7 @@ class GbpOptionParser(OptionParser): 'arch' : '', 'interactive' : 'True', 'color' : 'auto', + 'color-scheme' : '', 'customizations' : '', 'spawn-editor' : 'release', 'patch-numbers' : 'True', @@ -204,6 +205,11 @@ class GbpOptionParser(OptionParser): "Run command interactively, default is '%(interactive)s'", 'color': "Whether to use colored output, default is '%(color)s'", + 'color-scheme': + ("Colors to use in output (when color is enabled), format " + "is '<debug>:<info>:<warning>:<error>', e.g. " + "'cyan:34::'. Numerical values and color names are " + "accepted, empty fields indicate using the default."), 'spawn-editor': ("Whether to spawn an editor after adding the " "changelog entry, default is '%(spawn-editor)s'"), diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 4137e665..09d40829 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -372,6 +372,8 @@ def parse_args(argv, prefix): parser.add_option("--git-verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") parser.add_config_file_option(option_name="notify", dest="notify", type='tristate') tag_group.add_option("--git-tag", action="store_true", dest="tag", default=False, help="create a tag after a successful build") @@ -428,7 +430,7 @@ def parse_args(argv, prefix): export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay") options, args = parser.parse_args(args) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) if options.retag: if not options.tag and not options.tag_only: gbp.log.err("'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix)) diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py index 65dbc20b..e7853abe 100755 --- a/gbp/scripts/clone.py +++ b/gbp/scripts/clone.py @@ -45,9 +45,11 @@ def parse_args (argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") (options, args) = parser.parse_args(argv) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) return (options, args) diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py index 1e8de0ce..bf6fe6a8 100644 --- a/gbp/scripts/create_remote_repo.py +++ b/gbp/scripts/create_remote_repo.py @@ -270,6 +270,8 @@ def parse_args(argv, sections=[]): parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") parser.add_option("--remote-name", dest="name", default="origin", @@ -295,7 +297,7 @@ def main(argv): print >>sys.stderr, "%s" % e return 1 - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) try: repo = DebianGitRepository(os.path.curdir) except GitRepositoryError: diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index 5c253f9b..8fbfad38 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -367,6 +367,8 @@ def main(argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") range_group.add_option("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, debian/0.4.3)") range_group.add_option("-a", "--auto", action="store_true", dest="auto", default=False, help="autocomplete changelog from last snapshot or tag") @@ -412,7 +414,7 @@ def main(argv): help=help_msg) (options, args) = parser.parse_args(argv[1:]) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) dch_options = process_options(options, parser) editor_cmd = process_editor_option(options) diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py index 28ceb2eb..98b2d42f 100644 --- a/gbp/scripts/import_dsc.py +++ b/gbp/scripts/import_dsc.py @@ -200,6 +200,8 @@ def parse_args(argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") parser.add_option("--download", action="store_true", dest="download", default=False, help="download source package") branch_group.add_config_file_option(option_name="debian-branch", @@ -234,6 +236,7 @@ def parse_args(argv): (options, args) = parser.parse_args(argv[1:]) gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) return options, args diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index cb3bf026..d230a966 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -227,6 +227,8 @@ def parse_args(argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") # Accepted for compatibility parser.add_option("--no-dch", dest='no_dch', action="store_true", @@ -235,7 +237,7 @@ def parse_args(argv): default=False, help="use uscan(1) to download the new tarball.") (options, args) = parser.parse_args(argv[1:]) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) if options.no_dch: gbp.log.warn("'--no-dch' passed. This is now the default, please remove this option.") diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 3f7cd52f..7755e0d3 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -207,9 +207,11 @@ def main(argv): parser.add_option("--force", dest="force", action="store_true", default=False, help="in case of import even import if the branch already exists") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") (options, args) = parser.parse_args(argv) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) if len(args) < 2: gbp.log.err("No action given.") diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py index 3f517497..c4c2b4c8 100755 --- a/gbp/scripts/pull.py +++ b/gbp/scripts/pull.py @@ -86,10 +86,12 @@ def main(argv): parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_config_file_option(option_name="color", dest="color", type='tristate') + parser.add_config_file_option(option_name="color-scheme", + dest="color_scheme") (options, args) = parser.parse_args(argv) - gbp.log.setup(options.color, options.verbose) + gbp.log.setup(options.color, options.verbose, options.color_scheme) try: repo = DebianGitRepository(os.path.curdir) |