om4r932 commited on
Commit
271cfb4
·
verified ·
1 Parent(s): 95dd437

Handling xx.yyy-zz format

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -197,7 +197,7 @@ class SpecDocFinder:
197
  item = items[-1].find("a")
198
  except Exception as e:
199
  return f"Unable to find specification {doc_id} : {e}"
200
- a, b, c = [_ for _ in item.get_text().split("-")[1].replace(".zip", "")]
201
  version = f"{self.chars.index(a)}.{self.chars.index(b)}.{self.chars.index(c)}"
202
  version_found = (version, item.get("href"))
203
  _, spec_url = version_found
@@ -206,7 +206,7 @@ class SpecDocFinder:
206
  for item in items:
207
  x = item.find("a")
208
  if f"{doc_id.replace('.', '')}-{self.chars[int(release)]}" in x.get_text():
209
- a, b, c = [_ for _ in x.get_text().split("-")[1].replace(".zip", "")]
210
  version = f"{self.chars.index(a)}.{self.chars.index(b)}.{self.chars.index(c)}"
211
  version_found = (version, x.get("href"))
212
  _, spec_url = version_found
 
197
  item = items[-1].find("a")
198
  except Exception as e:
199
  return f"Unable to find specification {doc_id} : {e}"
200
+ a, b, c = [_ for _ in item.get_text().split("-")[-1].replace(".zip", "")]
201
  version = f"{self.chars.index(a)}.{self.chars.index(b)}.{self.chars.index(c)}"
202
  version_found = (version, item.get("href"))
203
  _, spec_url = version_found
 
206
  for item in items:
207
  x = item.find("a")
208
  if f"{doc_id.replace('.', '')}-{self.chars[int(release)]}" in x.get_text():
209
+ a, b, c = [_ for _ in x.get_text().split("-")[-1].replace(".zip", "")]
210
  version = f"{self.chars.index(a)}.{self.chars.index(b)}.{self.chars.index(c)}"
211
  version_found = (version, x.get("href"))
212
  _, spec_url = version_found