def main(): writer = HTMLwriter() writer.startBasicPage() # performSearch('Ljuden från kosmos', writer) # performSearch('Herman Melville', writer) # performSearch('mozart', writer) performSearch('Baskervilles hund', writer) # performSearch('gris', writer) writer.closeBasicPage()
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Samsok is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Foobar. If not, see <http://www.gnu.org/licenses/>. import cgi import cgitb from html import HTMLwriter from search import performSearch cgitb.enable() HTMLmachine = HTMLwriter() HTMLmachine.startBasicPage() HTMLmachine.outputSearchbox() storage = [] form = cgi.FieldStorage() if "search" in form: performSearch(form['search'].value, HTMLmachine) HTMLmachine.closeBasicPage()
# You should have received a copy of the GNU General Public License # along with Foobar. If not, see <http://www.gnu.org/licenses/>. import cgi import cgitb cgitb.enable() # First off, modify the path to allow any locally installed packages import config import sys import os import json for folder in json.loads( config.parser.get(config.defaultSection, 'localLibFolders')): sys.path.append(os.path.abspath(folder)) from html import HTMLwriter from search import performSearch if __name__ == '__main__': HTMLmachine = HTMLwriter() HTMLmachine.startBasicPage() HTMLmachine.outputSearchbox() storage = [] form = cgi.FieldStorage() if "search" in form: performSearch(form['search'].value, HTMLmachine) HTMLmachine.closeBasicPage()