[edk2-devel][edk2-staging/EdkRepo][PATCH v2 7/8] EdkRepo: Argument Strings Refactor - Clone Command

Nate DeSimone nathaniel.l.desimone at intel.com
Wed Nov 6 22:44:34 UTC 2019


Reviewed-by: Nate DeSimone <nathaniel.l.desimone at intel.com>

-----Original Message-----
From: Desimone, Ashley E <ashley.e.desimone at intel.com> 
Sent: Wednesday, November 6, 2019 2:40 PM
To: devel at edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Pandya, Puja <puja.pandya at intel.com>
Subject: [edk2-devel][edk2-staging/EdkRepo][PATCH v2 7/8] EdkRepo: Argument Strings Refactor - Clone Command

Move all argument strings for clone_command.py to edkrepo/commands/arguments/clone_args.py

Signed-off-by: Ashley E Desimone <ashley.e.desimone at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Puja Pandya <puja.pandya at intel.com>
---
 edkrepo/commands/arguments/clone_args.py | 22 ++++++++++++++++++++++
 edkrepo/commands/clone_command.py        | 24 +++++++-----------------
 edkrepo/common/argument_strings.py       | 14 --------------
 3 files changed, 29 insertions(+), 31 deletions(-)  create mode 100644 edkrepo/commands/arguments/clone_args.py

diff --git a/edkrepo/commands/arguments/clone_args.py b/edkrepo/commands/arguments/clone_args.py
new file mode 100644
index 0000000..b143adc
--- /dev/null
+++ b/edkrepo/commands/arguments/clone_args.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+#
+## @file
+# clone_args.py
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> # 
+SPDX-License-Identifier: BSD-2-Clause-Patent #
+
+''' Contains the help and description strings for arguments in the 
+clone command meta data.
+'''
+
+COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace.'
+WORKSPACE_HELP = ('The destination for the newly created workspace, this must be an empty directory.\n'
+                  'A value of "." indicates the current working 
+directory.') PROJECT_MANIFEST_HELP = ('Either a project name as listed by "edkrepo manifest" or the path to a project manifest file.\n'
+                         'If a relative path is provided clone will first search relative to the current working directory'
+                         ' and then search relative to the global 
+manifest repository.') COMBINATION_HELP = 'The name of the combination to checkout. If not specified the projects default combination is used.'
+SPARSE_HELP = 'Enables sparse checkout if supported by the project manifest file.'
+NO_SPARSE_HELP = 'Disables sparse checkout if the project manifest file enables it by default.'
\ No newline at end of file
diff --git a/edkrepo/commands/clone_command.py b/edkrepo/commands/clone_command.py
index e74c4e4..2400272 100644
--- a/edkrepo/commands/clone_command.py
+++ b/edkrepo/commands/clone_command.py
@@ -10,14 +10,9 @@
 import os
 import shutil
 
-
-# Our modules
 from edkrepo.commands.edkrepo_command import EdkrepoCommand  from edkrepo.commands.edkrepo_command import SubmoduleSkipArgument -from edkrepo.common.argument_strings import PROJECT_OR_MANIFEST_DESCRIPTION, PROJECT_OR_MANIFEST_HELP -from edkrepo.common.argument_strings import COMBINATION_DESCRIPTION, COMBINATION_HELP, WORKSPACE_DESCRIPTION -from edkrepo.common.argument_strings import WORKSPACE_HELP, CLONE_COMMAND_DESCRIPTION -from edkrepo.common.argument_strings import SPARSE_HELP, SPARSE_DESCRIPTION, NO_SPARSE_DESCRIPTION, NO_SPARSE_HELP
+import edkrepo.commands.arguments.clone_args as arguments
 from edkrepo.common.common_repo_functions import pull_latest_manifest_repo, clone_repos, sparse_checkout, verify_manifest_data  from edkrepo.common.common_repo_functions import case_insensitive_single_match, update_editor_config  from edkrepo.common.common_repo_functions import write_included_config, write_conditional_include @@ -35,37 +30,32 @@ class CloneCommand(EdkrepoCommand):
     def get_metadata(self):
         metadata = {}
         metadata['name'] = 'clone'
-        metadata['help-text'] = CLONE_COMMAND_DESCRIPTION
+        metadata['help-text'] = arguments.COMMAND_DESCRIPTION
         args = []
         metadata['arguments'] = args
         args.append({'name': 'Workspace',
                      'positional': True,
                      'position': 0,
                      'required': True,
-                     'description': WORKSPACE_DESCRIPTION,
-                     'help-text': WORKSPACE_HELP})
+                     'help-text': arguments.WORKSPACE_HELP})
         args.append({'name': 'ProjectNameOrManifestFile',
                      'positional': True,
                      'position': 1,
                      'required': True,
-                     'description': PROJECT_OR_MANIFEST_DESCRIPTION,
-                     'help-text': PROJECT_OR_MANIFEST_HELP})
+                     'help-text': arguments.PROJECT_MANIFEST_HELP})
         args.append({'name': 'Combination',
                      'positional': True,
                      'position': 2,
                      'required': False,
-                     'description': COMBINATION_DESCRIPTION,
-                     'help-text': COMBINATION_HELP})
+                     'help-text': arguments.COMBINATION_HELP})
         args.append({'name': 'sparse',
                      'positional': False,
                      'required': False,
-                     'description': SPARSE_DESCRIPTION,
-                     'help-text': SPARSE_HELP})
+                     'help-text': arguments.SPARSE_HELP})
         args.append({'name': 'nosparse',
                      'positional': False,
                      'required': False,
-                     'description': NO_SPARSE_DESCRIPTION,
-                     'help-text': NO_SPARSE_HELP})
+                     'help-text': arguments.NO_SPARSE_HELP})
         args.append(SubmoduleSkipArgument)
         return metadata
 
diff --git a/edkrepo/common/argument_strings.py b/edkrepo/common/argument_strings.py
index b001441..75e13ee 100644
--- a/edkrepo/common/argument_strings.py
+++ b/edkrepo/common/argument_strings.py
@@ -18,18 +18,4 @@ OVERRIDE_HELP = 'Ignore warnings'
 SUBMODULE_SKIP_HELP = 'Skip the pull or sync of any submodules.'
 COLOR_HELP = 'Force color output (useful with \'less -r\')'
 
-#Args for clone_command.py
-CLONE_COMMAND_DESCRIPTION = 'Downloads a project and creates a new workspace'
-WORKSPACE_DESCRIPTION = 'The workspace in which to clone.'
-WORKSPACE_HELP = 'The workspace in which to clone. This must refer to an empty directory. A value of "." indicates the current working directory \n'
-PROJECT_OR_MANIFEST_DESCRIPTION = 'The project name as listed in the CiIndex.xml file or the name of the manifest file'
-PROJECT_OR_MANIFEST_HELP = ('The project name as listed in the CiIndex.xml file or a path to a manifest file. If a relative path to a manifest file is provided ' +
-                            'clone will attempt to find it by first searching relative to the current working directory and then searchting relative to the ' +
-                            'global manifest repository \n')
-COMBINATION_DESCRIPTION = 'The combination to checkout'
-COMBINATION_HELP = 'The combination name to checkout if not specified the default combination is used.\n'
-SPARSE_DESCRIPTION = 'Enables sparse checkout support.'
-SPARSE_HELP = 'Enables a sparse checkout based on the contents of the DSC file(s) listed by the manifest.\n'
-NO_SPARSE_DESCRIPTION = 'Disables sparse checkout support.'
-NO_SPARSE_HELP = 'Disables sparse checkout if enabled by default in the manifest.\n'
 
--
2.16.2.windows.1


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

View/Reply Online (#50098): https://edk2.groups.io/g/devel/message/50098
Mute This Topic: https://groups.io/mt/44653269/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