fix small issues with archive refroctoring
This commit is contained in:
parent
849e57f450
commit
387c13be6d
@ -88,15 +88,15 @@ class Archive:
|
||||
data = None # "raw" json data
|
||||
db_con = None
|
||||
|
||||
def __init__(self, archive_name, archive_dir_or_db_config):
|
||||
def __init__(self, archive_name, config):
|
||||
|
||||
if isinstance(archive_dir_or_db_config, str):
|
||||
if isinstance(config, str):
|
||||
# need a filename or a dir name....
|
||||
print("reading archive " + archive_name, end='')
|
||||
archive_dir = archive_dir_or_db_config
|
||||
archive_dir = config
|
||||
(self.data, self.archive_name) = load_from_file(archive_name, archive_name, archive_dir)
|
||||
print(" - done.")
|
||||
elif isinstance(archive_dir_or_db_config, dict):
|
||||
elif isinstance(config, dict):
|
||||
self.archive_name = archive_name
|
||||
self.db_con = connect_db(config['database'], config['host'], config['user'], config['password'])
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
from flask import render_template, request, jsonify
|
||||
from flask import render_template, request, jsonify, send_from_directory
|
||||
from www import app
|
||||
import archive.archive as archive
|
||||
import config
|
||||
@ -21,7 +21,7 @@ def searh():
|
||||
|
||||
if len(request.args) < 1:
|
||||
# q: list all table or keep predefined wconfig.lists_to_serve?
|
||||
wconfig.lists_to_serve = archive.show_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
|
||||
wconfig.lists_to_serve = archive.list_tables_db(config.db['database'], config.db['host'], config.db['user'], config.db['password'])
|
||||
return render_template("search.html", archives=wconfig.lists_to_serve, fields=['content', 'from'])
|
||||
|
||||
k_arg = request.args.get('keyword')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user