Skip to content

Commit

Permalink
improves
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Apr 11, 2024
1 parent f71ddee commit 87eda59
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions frontend/wikigrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pathlib import Path

from lodstorage.lod import LOD
from ngwidgets.background import BackgroundTaskHandler
from ngwidgets.lod_grid import ListOfDictsGrid
from ngwidgets.progress import NiceguiProgressbar, Progressbar
from ngwidgets.widgets import Link
Expand Down Expand Up @@ -75,12 +74,10 @@ class WikiGrid:
A grid of Wikis.
"""

def __init__(self, napp):
# back reference to nicegui app
self.napp = napp
self.bth = BackgroundTaskHandler()
app.on_shutdown(self.bth.cleanup())

def __init__(self, solution):
# back reference to nicegui solution
self.solution = solution

self.wiki_users = WikiUser.getWikiUsers()
self.wiki_clients = {}
self.smw_clients = {}
Expand Down Expand Up @@ -161,7 +158,7 @@ def run_wiki_checks(self, progress_bar: Progressbar = None):
# Update the progress bar
progress_bar.update(1)
except BaseException as ex:
self.napp.handle_exception(ex)
self.solution.handle_exception(ex)

def check_pages(self, wiki_state):
"""
Expand All @@ -180,7 +177,7 @@ def check_pages(self, wiki_state):
self.lod_grid.update_row(wiki_state.row_no, "pages", "❌")
return
except BaseException as ex:
self.napp.handle_exception(ex)
self.solution.handle_exception(ex)

def check_wiki_version(self, wiki_state):
"""
Expand All @@ -203,7 +200,7 @@ def check_wiki_version(self, wiki_state):
wiki_state.row_no, "version", f"{ex_version}!={mw_version}❌"
)
except BaseException as ex:
self.napp.handle_exception(ex)
self.solution.handle_exception(ex)

def check_backup(self, wiki_state):
"""
Expand All @@ -229,4 +226,4 @@ def check_backup(self, wiki_state):
msg = "❌"
self.lod_grid.update_row(wiki_state.row_no, "backup", msg)
except BaseException as ex:
self.napp.handle_exception(ex)
self.solution.handle_exception(ex)

0 comments on commit 87eda59

Please # to comment.