Blame 0002-Revert-Add-xml_parse_main_metadata_together-to-pytho.patch

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