From f7545cc35f79bd18fafa0972f274e4cde7a6c552 Mon Sep 17 00:00:00 2001
From: Peter Cock
Date: Mon, 3 Aug 2026 13:22:44 +0100
Subject: [PATCH] Stop parsing interpro.xml once have release info
After adding additional logging I found `funannotate2 install -d interpro`
was hanging in the XML parsing despite having already found the key
information.
This patch stops parsing the XML once the release information is found.
The command then completes almost immediately after the download and unzip have finished.
---
funannotate2/install.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/funannotate2/install.py b/funannotate2/install.py
index 0cd8387..484c718 100644
--- a/funannotate2/install.py
+++ b/funannotate2/install.py
@@ -718,6 +718,7 @@ def interproDB(wget=False):
num_records = ""
version = ""
iprdate = ""
+ xml_done = False
for event, elem in cElementTree.iterparse(iprXML):
if elem.tag == "release":
for x in list(elem):
@@ -725,6 +726,10 @@ def interproDB(wget=False):
num_records = int(x.attrib["entry_count"])
version = x.attrib["version"]
iprdate = x.attrib["file_date"]
+ xml_done = True
+ break
+ if xml_done:
+ break
try:
iprdate = datetime.datetime.strptime(iprdate, "%d-%b-%y").strftime("%Y-%m-%d")
except ValueError: