Reviewed-by: Erik Bjorge <[email protected]>

-----Original Message-----
From: Desimone, Ashley E <[email protected]> 
Sent: Thursday, April 16, 2020 8:31 PM
To: [email protected]
Cc: Desimone, Nathaniel L <[email protected]>; Pandya, Puja 
<[email protected]>; Bjorge, Erik C <[email protected]>; Bret 
Barkelew <[email protected]>; Agyeman, Prince 
<[email protected]>
Subject: [edk2-staging/EdkRepo] [PATCH 6/6] EdkRepo: Add 'get' functions for 
Manifest Repo data

Added functions to get the URL, LocalPath, Branch and the absolute path for 
individual manifest repositories to the BaseConfig class.

Signed-off-by: Ashley E Desimone <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Puja Pandya <[email protected]>
Cc: Erik Bjorge <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Prince Agyeman <[email protected]>
---
 edkrepo/config/config_factory.py | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index a4daba3..022e0bb 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -131,6 +131,43 @@ class BaseConfig():
                 repo_props.append(prop)
         return repo_props
 
+    def get_manifest_repo_url(self, manifest_repo):
+        """ 
+        Returns the URL value for a given manifest repo based on config
+        file contents.
+        """
+        for prop in self.manifest_repo_props(manifest_repo):
+            if 'URL' == prop.key:
+                return self.cfg[prop.section][prop.key]
+        return None
+
+    def get_manifest_repo_branch(self, manifest_repo):
+        """
+        Returns the Branch value for a given manifest repo based on config file
+        contents.
+        """
+        for prop in self.manifest_repo_props(manifest_repo):
+            if 'Branch' == prop.key:
+                return self.cfg[prop.section][prop.key]
+        return None
+
+    def get_manifest_repo_local_path(self, manifest_repo):
+        """
+        Returns the Local path value for a given manifest repo based on config
+        file contents.
+        """
+        for prop in self.manifest_repo_props(manifest_repo):
+            if 'LocalPath' == prop.key:
+                return self.cfg[prop.section][prop.key]
+        return None
+
+    def manifest_repo_abs_path(self, manifest_repo):
+        """
+        Returns the absolute path of a single manifest repo based on config
+        file contents and the global_data_dir location.
+        """
+        return os.path.join(self.global_data_dir, 
+ self.get_manifest_repo_local_path(manifest_repo))
+
 class GlobalConfig(BaseConfig):
     """
     Class access structure for the edkrepo.cfg file.  This file is read only 
and maintained by the
--
2.16.2.windows.1


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

View/Reply Online (#57513): https://edk2.groups.io/g/devel/message/57513
Mute This Topic: https://groups.io/mt/73070624/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to