Skip to content

Commit

Permalink
improves wikidata sync
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Jun 7, 2024
1 parent 8cc15bb commit 86417df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ceurws/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def createExternalLink(
str - html link for external id
"""
value = self.getRowValue(row, key)
if not value:
if not value or value==View.noneValue:
if emptyIfNone:
return ""
else:
Expand Down
11 changes: 5 additions & 6 deletions ceurws/wikidata_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ def reload_aggrid(self, olod: list):
itemLink = self.createItemLink(row, "item")
eventLink = self.createItemLink(row, "event", separator="|")
eventSeriesLink = self.createItemLink(row, "eventSeries", separator="|")
dblpLink = self.createExternalLink(row, "dblpProceedingsId", "dblp", DblpEndpoint.DBLP_REC_PREFIX, emptyIfNone=True)
dblpLink = self.createExternalLink(row, "dblpProceedingsId", "dblp", DblpEndpoint.DBLP_REC_PREFIX)
k10PlusLink = self.createExternalLink(
row,
"ppnId",
"k10plus",
"https://opac.k10plus.de/DB=2.299/PPNSET?PPN=",
emptyIfNone=True
"https://opac.k10plus.de/DB=2.299/PPNSET?PPN="
)
lod.append(
{
Expand All @@ -93,9 +92,9 @@ def reload_aggrid(self, olod: list):
}
)
self.lod_grid.load_lod(lod)
for col_def in self.lod_grid.ag_grid.options["columnDefs"]:
if col_def["field"] == "Item": # Identify the "Title" column
col_def["maxWidth"] = 350 # width in pixels
# set max width of Item column
self.lod_grid.set_column_def("item","maxWidth",380)
self.lod_grid.set_column_def("event","maxWidth",380)
self.lod_grid.sizeColumnsToFit()

async def on_refresh_button_click(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies = [
# https://pypi.org/project/neo4j/
'neo4j',
# https://github.com/WolfgangFahl/nicegui_widgets
'ngwidgets>=0.12.5',
'ngwidgets>=0.15.2',
# https://pypi.org/project/sqlmodel/
'sqlmodel>=0.0.16',
# https://pypi.org/project/wdgrid/
Expand Down

0 comments on commit 86417df

Please sign in to comment.