From 4dce0816099c5d2c172845665c1bef592ffc11fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
Date: Wed, 9 Mar 2022 15:23:29 +0100
Subject: [PATCH] Revert "Add xml_parse_main_metadata_together to python parser
examples"
This reverts commit 0633e31e491179f0153ef8267874812b4691957b.
---
examples/python/repodata_parsing.py | 46 -----------------------------
1 file changed, 46 deletions(-)
diff --git a/examples/python/repodata_parsing.py b/examples/python/repodata_parsing.py
index 4519518..ea517a1 100755
--- a/examples/python/repodata_parsing.py
+++ b/examples/python/repodata_parsing.py
@@ -211,48 +211,6 @@ def second_method():
for pkg in packages.values():
print_package_info(pkg)
-def third_method():
- """Parsing main metadata types (primary, filelists, other) at the same time.
- This approach significantly reduces memory footprint because we don't need
- to keep all the packages in memory, user can handle them one by one.
-
- The API reflects xml_parse_primary/filelists/other except that it handles
- all of them at the same time.
-
- """
- def warningcb(warning_type, message):
- print("PARSER WARNING: %s" % message)
- return True
-
- repomd = cr.Repomd()
- cr.xml_parse_repomd(os.path.join(REPO_PATH, "repodata/repomd.xml"), repomd, warningcb)
-
- primary_xml_path = None
- filelists_xml_path = None
- other_xml_path = None
- for record in repomd.records:
- if record.type == "primary":
- primary_xml_path = os.path.join(REPO_PATH, record.location_href)
- elif record.type == "filelists":
- filelists_xml_path = os.path.join(REPO_PATH, record.location_href)
- elif record.type == "other":
- other_xml_path = os.path.join(REPO_PATH, record.location_href)
-
- #
- # Main XML metadata parsing (primary, filelists, other)
- #
-
- def pkgcb(pkg):
- # Called when whole package entry from all 3 metadata xml files is parsed
- print_package_info(pkg)
-
- cr.xml_parse_main_metadata_together(primary_xml_path,
- filelists_xml_path,
- other_xml_path,
- None,
- pkgcb,
- warningcb,
- False)
if __name__ == "__main__":
print('"All in one shot" method:')
@@ -263,7 +221,3 @@ if __name__ == "__main__":
print("Callback based method:")
second_method()
- print()
-
- print("Streaming callback based method:")
- third_method()
--
2.34.3