From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.1731.1587143914323167629 for ; Fri, 17 Apr 2020 10:18:34 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: ashley.e.desimone@intel.com) IronPort-SDR: +ed16TKhnoDo4Cb/nJzudlPo70+DEZNVPhctGWn68IpUqHOfbV3kcljyOTc8hWvfe8UWmbsiB5 cZwIk0SGgPZA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2020 10:18:33 -0700 IronPort-SDR: Tkx1Nedl+MgB+epYaV0h+HKdpo9pM9Gp3Y+BW0xiVNpfrPhe/nkVCvq8Jy9mRMcOyxoBTfzIOk Qptbg4NPNXQw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,395,1580803200"; d="scan'208";a="243070614" Received: from aedesimo-desk.amr.corp.intel.com ([10.7.159.171]) by orsmga007.jf.intel.com with ESMTP; 17 Apr 2020 10:18:32 -0700 From: "Ashley E Desimone" To: devel@edk2.groups.io Cc: Nate DeSimone , Puja Pandya , Erik Bjorge , Bret Barkelew , Prince Agyeman Subject: [edk2-staging/EdkRepo] [PATCH v2 6/6] EdkRepo: Add 'get' functions for Manifest Repo data Date: Fri, 17 Apr 2020 10:18:29 -0700 Message-Id: <20200417171829.23032-7-ashley.e.desimone@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200417171829.23032-1-ashley.e.desimone@intel.com> References: <20200417171829.23032-1-ashley.e.desimone@intel.com> 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 Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Bret Barkelew Cc: Prince Agyeman --- 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 4ae06f6..90f393c 100644 --- a/edkrepo/config/config_factory.py +++ b/edkrepo/config/config_factory.py @@ -127,6 +127,43 @@ class BaseConfig(): """ return [x for x in self.prop_list if manifest_repo in x.name] + 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