Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions conf/contributors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,7 @@ Please keep the list in alphabetical order by last name!
trac="mkohlhase"/>
<contributor
name="Matthias Köppe"
altnames="Matthias Koeppe"
work="Professor, UC Davis"
location="Davis, CA, USA"
description="build system (2016-2022); continuous integration (2020-2022); modularization (2020-2022); polyhedral geometry and optimization (2015-2022); manifolds (2021-2022)"
Expand Down Expand Up @@ -2176,11 +2177,6 @@ Please keep the list in alphabetical order by last name!
url="https://jplab.github.io/"
trac="jipilab"
github="jplab"/>
<contributor
name="Jean-Philippe Labbé"
location="BMS-Freie Universitat, Berlin, Germany"
url="http://page.mi.fu-berlin.de/labbe"
trac="jipilab"/>
<contributor
name="Sébastien Labbé"
work="CNRS researcher, LaBRI, Université de Bordeaux"
Expand Down
40 changes: 32 additions & 8 deletions scripts/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@

# google key for sagemath.org - no longer a free one available
# this is an "api key" credential for GCP's "Geocode API"
gkey = open(os.path.expanduser("~/geocode.key")).read().strip()
try:
gkey = open(os.path.expanduser("~/geocode.key")).read().strip()
except FileNotFoundError:
gkey = None

# allowed attributes in source xml, for checkXML
goodKeys = [
"name", "location", "work", "description", "url", "pix", "size", "jitter",
"name", "altnames", "location", "work", "description", "url", "pix", "size", "jitter",
"trac", "github", "gitlab"
]

Expand Down Expand Up @@ -95,11 +98,13 @@ def writeToDevmap():
if c.tagName != "contributor":
continue
dev = c.getAttribute("name")
altnames = c.getAttribute("altnames")
loc = c.getAttribute("location")
work = c.getAttribute("work")
descr = c.getAttribute("description")
url = c.getAttribute("url")
trac = c.getAttribute("trac")
github = c.getAttribute("github")

tr = devmap.createElement("tr")
td = devmap.createElement("td")
Expand Down Expand Up @@ -134,14 +139,31 @@ def writeToDevmap():
d_el = parseString("<span>%s</span>" % d)
td.appendChild(d_el.firstChild)

if len(trac) == 0:
trac = dev
trac = trac.replace(" ", "%20")
a = devmap.createElement("a")
a.setAttribute("href", tracSearch + trac)
tracQuery = f"https://trac.sagemath.org/query?"
main_trac = None
trac_list = [t.strip() for t in trac.split(',') if t.strip()]
gh_trac_list = [f'gh-{gh.strip()}' for gh in github.split(',') if gh.strip()]
for trac in trac_list + gh_trac_list:
if not main_trac:
main_trac = trac
tracQuery += f"&or&cc=~{trac}"
tracQuery += f"&or&reporter=~{trac}"
tracQuery += f"&or&owner=~{trac}"
for name in [dev] + altnames.split(','):
name = name.strip()
if not name:
continue
tracQuery += f"&or&author=~{name}"
tracQuery += f"&or&reviewer=~{name}"
tracQuery += "&max=500&col=id&col=summary&col=author&col=status&col=priority&col=milestone&col=reviewer&order=priority"
tracQuery = tracQuery.replace(" ", "%20")
a.setAttribute("href", tracQuery)
a.setAttribute("class", "trac")
#a.setAttribute("target", "_blank")
a.appendChild(devmap.createTextNode("contributions"))
if main_trac:
a.appendChild(devmap.createTextNode(f"contributions (trac: {main_trac})"))
else:
a.appendChild(devmap.createTextNode(f"contributions (trac)"))
td.appendChild(devmap.createElement("br"))
td.appendChild(a)

Expand Down Expand Up @@ -189,6 +211,8 @@ def getGeo(loc):
CSV Geo returns: [200,6,42.730070,-73.690570]
[retcode,accuracy,lng,lat]
"""
if not gkey:
return None
loc = loc.replace(" ", "+")
loc = quote(loc.encode('UTF-8'))
print(loc, ">>>", end="")
Expand Down