[edk2-devel] [edk2-staging/EdkRepo] [PATCH v1 2/7] EdkRepo: Added ability to display archived combinations

Desimone, Ashley E ashley.e.desimone at intel.com
Wed Apr 1 21:54:02 UTC 2020


Reviewed-by: Ashley DeSimone <ashley.e.desimone at intel.com>

-----Original Message-----
From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Bjorge, Erik C
Sent: Tuesday, March 31, 2020 3:42 PM
To: devel at edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Pandya, Puja <puja.pandya at intel.com>; Bret Barkelew <Bret.Barkelew at microsoft.com>; Agyeman, Prince <prince.agyeman at intel.com>
Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH v1 2/7] EdkRepo: Added ability to display archived combinations

Added support for using the -a / --archived flags to include archived combinations.

Signed-off-by: Erik Bjorge <erik.c.bjorge at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Puja Pandya <puja.pandya at intel.com>
Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
Cc: Prince Agyeman <prince.agyeman at intel.com>
---
 edkrepo/commands/arguments/combo_args.py |  5 +++--
 edkrepo/commands/combo_command.py        | 19 +++++++++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/edkrepo/commands/arguments/combo_args.py b/edkrepo/commands/arguments/combo_args.py
index af3ded9..dabb464 100644
--- a/edkrepo/commands/arguments/combo_args.py
+++ b/edkrepo/commands/arguments/combo_args.py
@@ -3,7 +3,7 @@
 ## @file
 # combo_args.py
 #
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2020, Intel Corporation. All rights 
+reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #
 
@@ -11,4 +11,5 @@
 combo command meta data.
 '''
 
-COMMAND_DESCRIPTION = 'Displays the currently checked out combination and lists all available combinations.'
\ No newline at end of file
+COMMAND_DESCRIPTION = 'Displays the currently checked out combination and lists all available combinations.'
+ARCHIVED_HELP = 'Include a listing of archived combinations.'
diff --git a/edkrepo/commands/combo_command.py b/edkrepo/commands/combo_command.py
index 68d6854..9e13f47 100644
--- a/edkrepo/commands/combo_command.py
+++ b/edkrepo/commands/combo_command.py
@@ -3,10 +3,11 @@
 ## @file
 # combo_command.py
 #
-# Copyright (c) 2017- 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017- 2020, Intel Corporation. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  from colorama import Fore
+from colorama import Style
 
 from edkrepo.commands.edkrepo_command import EdkrepoCommand  from edkrepo.commands.edkrepo_command import ColorArgument @@ -25,6 +26,11 @@ class ComboCommand(EdkrepoCommand):
         metadata['help-text'] = arguments.COMMAND_DESCRIPTION
         args = []
         metadata['arguments'] = args
+        args.append({'name': 'archived',
+                     'short-name': 'a',
+                     'positional': False,
+                     'required': False,
+                     'help-text': arguments.ARCHIVED_HELP})
         args.append(ColorArgument)
         return metadata
 
@@ -32,9 +38,18 @@ class ComboCommand(EdkrepoCommand):
         init_color_console(args.color)
 
         manifest = get_workspace_manifest()
-        for combo in [c.name for c in manifest.combinations]:
+        combo_archive = []
+        combo_list = [c.name for c in manifest.combinations]
+        if args.archived:
+            combo_archive = [c.name for c in manifest.archived_combinations]
+            combo_list.extend(combo_archive)
+        if manifest.general_config.current_combo not in combo_list:
+            combo_list.append(manifest.general_config.current_combo)
+        for combo in sorted(combo_list):
             if combo == manifest.general_config.current_combo:
                 print("* {}{}{}".format(Fore.GREEN, combo, Fore.RESET))
+            elif combo in combo_archive:
+                print("  {}{}{}{}".format(Fore.YELLOW, Style.BRIGHT, 
+ combo, Style.RESET_ALL))
             else:
                 print("  {}".format(combo))
             if args.verbose:
--
2.21.0.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#56870): https://edk2.groups.io/g/devel/message/56870
Mute This Topic: https://groups.io/mt/72688776/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list