From: Oleg Broytman Date: Thu, 4 Jan 2024 16:33:10 +0000 (+0300) Subject: Feat(wx/search): Search authors X-Git-Tag: 0.3.0~9^2~20 X-Git-Url: https://git.phdru.name/?p=m_librarian.git;a=commitdiff_plain;h=d64c85c78598c984e7e468903fde25fb55e23883 Feat(wx/search): Search authors [skip ci] --- diff --git a/m_librarian/wx/SearchPanel.py b/m_librarian/wx/SearchPanel.py index 26fb666..11633b3 100644 --- a/m_librarian/wx/SearchPanel.py +++ b/m_librarian/wx/SearchPanel.py @@ -1,6 +1,9 @@ # coding: utf-8 import wx +from ..search import search_authors_raw + +_search_types = ['start', 'substring', 'full'] class SearchPanel(wx.Panel): @@ -38,5 +41,8 @@ class SearchPanel(wx.Panel): def SearchAuthors(self, event): search_authors = self.search_authors.GetValue() - search_substr = self.search_substr.GetSelection() + search_substr = _search_types[self.search_substr.GetSelection()] search_case = self.search_case.GetValue() + if search_case is False: + search_case = None + search_authors_raw(search_authors, search_substr, search_case) diff --git a/scripts/ml-wx.py b/scripts/ml-wx.py index a482068..c0a6b46 100755 --- a/scripts/ml-wx.py +++ b/scripts/ml-wx.py @@ -1,12 +1,15 @@ #! /usr/bin/env python import sys + +from m_librarian.db import open_db from m_librarian.wx.Application import Application def main(): if len(sys.argv) > 1: sys.exit("This program doesn't accept any arguments") + open_db() app = Application() app.MainLoop()