Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add manifest_repo_props()

2020-04-17 Thread Ashley E Desimone
I am going to go with it was a long day. I will send out an updated patch set 
for review taking your feedback into account.

Thanks,
Ashley

-Original Message-
From: Bjorge, Erik C  
Sent: Friday, April 17, 2020 8:09 AM
To: Desimone, Ashley E ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Pandya, Puja 
; Bret Barkelew ; Agyeman, 
Prince 
Subject: RE: [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add 
manifest_repo_props()

Why is this not a list comprehension?

return [x for x in self.prop_list if manifest_repo in x.name]

-Original Message-
From: Desimone, Ashley E  
Sent: Thursday, April 16, 2020 8:31 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Pandya, Puja 
; Bjorge, Erik C ; Bret 
Barkelew ; Agyeman, Prince 

Subject: [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add manifest_repo_props()

Add the manifest_repo_props() function to the BaseConfig class which returns a 
list of all CfgProp objects for a given manifest repository.

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

diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index 6f89589..e053f8b 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -118,6 +118,17 @@ class BaseConfig():
 """Returns a list of available manifest repos"""
 if self.cfg.has_section('manifest-repos'):
 return self.cfg.options('manifest-repos')
+
+def manifest_repo_props(self, manifest_repo):
+"""
+Returns a list of cfg_prop objects that pertain to a given manifest
+repo
+"""
+repo_props = []
+for prop in self.prop_list:
+if manifest_repo in prop.name:
+repo_props.append(prop)
+return repo_props
 
 class GlobalConfig(BaseConfig):
 """
--
2.16.2.windows.1


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

View/Reply Online (#57536): https://edk2.groups.io/g/devel/message/57536
Mute This Topic: https://groups.io/mt/73070622/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add manifest_repo_props()

2020-04-17 Thread Bjorge, Erik C
Why is this not a list comprehension?

return [x for x in self.prop_list if manifest_repo in x.name]

-Original Message-
From: Desimone, Ashley E  
Sent: Thursday, April 16, 2020 8:31 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Pandya, Puja 
; Bjorge, Erik C ; Bret 
Barkelew ; Agyeman, Prince 

Subject: [edk2-staging/EdkRepo] [PATCH 4/6] EdkRepo: Add manifest_repo_props()

Add the manifest_repo_props() function to the BaseConfig class which returns a 
list of all CfgProp objects for a given manifest repository.

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

diff --git a/edkrepo/config/config_factory.py b/edkrepo/config/config_factory.py
index 6f89589..e053f8b 100644
--- a/edkrepo/config/config_factory.py
+++ b/edkrepo/config/config_factory.py
@@ -118,6 +118,17 @@ class BaseConfig():
 """Returns a list of available manifest repos"""
 if self.cfg.has_section('manifest-repos'):
 return self.cfg.options('manifest-repos')
+
+def manifest_repo_props(self, manifest_repo):
+"""
+Returns a list of cfg_prop objects that pertain to a given manifest
+repo
+"""
+repo_props = []
+for prop in self.prop_list:
+if manifest_repo in prop.name:
+repo_props.append(prop)
+return repo_props
 
 class GlobalConfig(BaseConfig):
 """
--
2.16.2.windows.1


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

View/Reply Online (#57509): https://edk2.groups.io/g/devel/message/57509
Mute This Topic: https://groups.io/mt/73070622/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-