diff options
-rw-r--r-- | backend/lib/sync.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py index 2d6244c..e53fa9b 100644 --- a/backend/lib/sync.py +++ b/backend/lib/sync.py @@ -8,16 +8,16 @@ pkg_url_base = "https://packages.gentoo.org/" http_session = requests.session() def get_project_data(): + projects = {} data = http_session.get(proj_url) if not data: print("Failed retrieving projects.xml") - return + return projects root = ET.fromstring(data.content) - projects = {} # Parsing is based on http://www.gentoo.org/dtd/projects.dtd as of 2016-11-10 if root.tag.lower() != 'projects': print("Downloaded projects.xml root tag isn't 'projects'") - return + return projects for proj_elem in root: if proj_elem.tag.lower() != 'project': print("Skipping unknown <projects> subtag <%s>" % proj_elem.tag) |