Skip to content

Commit

Permalink
tries fixing sotsog access
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Aug 22, 2024
1 parent 37f6b4c commit 61c4c9c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
41 changes: 22 additions & 19 deletions skg/skgbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from skg.scholargrid import ScholarGrid
from skg.version import Version
from skg.wikidata import Wikidata
from skg.sotsog import SotSog


class SkgBrowser(InputWebserver):
Expand Down Expand Up @@ -80,9 +81,10 @@ def __init__(self, webserver: SkgBrowser, client: Client):
"""
super().__init__(webserver, client) # Call to the superclass constructor
self.language = "en"
self.wikiId = "or"
self.wikiId = "cr"
self.markup_names = ["-", "bibtex", "scite", "smw"]
self.markup_name = self.markup_names[1]
self.sotsog = SotSog.instance

def configure_menu(self):
"""
Expand Down Expand Up @@ -182,7 +184,7 @@ def addWikiUserSelect(self):
wu_dict[wikiUser] = wikiUser
self.add_select("wiki:", wu_dict).bind_value(self, "wikiId")

async def scholars(self, client: Client):
async def scholars(self):
"""
scholar display
Expand All @@ -207,24 +209,25 @@ def configure_settings(self):
self.addLanguageSelect()
self.addWikiUserSelect()

async def home(self, _client: Client):
def setup_content(self):
with ui.splitter() as self.splitter:
with self.splitter.before:
self.add_select("markup", self.markup_names).bind_value(
self, "markup_name"
)
self.searchTerms = ui.textarea(placeholder="enter search terms")
self.searchButton = ui.button(
"search", on_click=self.onSearchButton
)
with self.splitter.after:
self.markup = ui.html()
self.messages = ui.html()
self.results = ui.html()

async def home(self):
"""
provide the main content page
"""
self.setup_menu()
with ui.element("div").classes("w-full h-full"):
with ui.splitter() as splitter:
with splitter.before:
self.add_select("markup", self.markup_names).bind_value(
self, "markup_name"
)
self.searchTerms = ui.textarea(placeholder="enter search terms")
self.searchButton = ui.button(
"search", on_click=self.onSearchButton
)
with splitter.after:
self.markup = ui.html()
self.messages = ui.html()
self.results = ui.html()
await self.setup_footer()

await self.setup_content_div(self.setup_content)
2 changes: 2 additions & 0 deletions skg/sotsog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class SotSog:
"""
Standing on the shoulders of giants
"""
instance=None

def __init__(self,debug:bool=False):
"""
constructor
"""
SotSog.instance=self
self.debug=debug
Node.debug = self.debug
self.wikipedia_url = (
Expand Down

0 comments on commit 61c4c9c

Please sign in to comment.