changed imports

This commit is contained in:
matthias@arch 2022-11-23 20:33:59 +01:00
parent 5064df1f0e
commit 165e25dac0
5 changed files with 16 additions and 14 deletions

View File

@ -1,9 +1,9 @@
import sqlite3 as sql import sqlite3 as sql
from re import match from re import match
from time import mktime from time import mktime
from database import t_request, t_user, t_file, t_filegroup, database_tables, get_filegroup
from sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize
from datetime import datetime as dt from datetime import datetime as dt
from .database import t_request, t_user, t_file, t_filegroup, database_tables, get_filegroup
from .sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize
""" """
collect information from the access log and put it into the database collect information from the access log and put it into the database

View File

@ -1,6 +1,6 @@
import sqlite3 as sql import sqlite3 as sql
from sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize
from os import path, listdir from os import path, listdir
from .sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize
""" """

View File

@ -1,10 +1,9 @@
from enum import auto
from collect import parse_log, add_requests_to_db
from sys import argv, exit from sys import argv, exit
from database import create_db from os.path import isfile
from os.path import isfile, isdir from .visualize import visualize
from visualize import visualize from .settings_manager import read_settings_file
from settings_manager import read_settings_file from .collect import parse_log, add_requests_to_db
from .database import create_db
""" """
start regina, launch either collect or visualize start regina, launch either collect or visualize
@ -64,7 +63,7 @@ def error(arg):
print("Error:", arg) print("Error:", arg)
exit(1) exit(1)
if __name__ == '__main__': def main():
config_file = "" config_file = ""
collect = False collect = False
visualize_ = False visualize_ = False
@ -110,3 +109,6 @@ if __name__ == '__main__':
if visualize_: if visualize_:
if not isfile(settings["db"]): error(f"Invalid database path: '{settings['db']}'") if not isfile(settings["db"]): error(f"Invalid database path: '{settings['db']}'")
visualize(settings) visualize(settings)
if __name__ == '__main__':
main()

View File

@ -1,12 +1,12 @@
import sqlite3 as sql import sqlite3 as sql
from sys import argv, exit from sys import argv, exit
from database import t_request, t_user, t_file, t_filegroup, database_tables
from sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize, sql_get_count_where
from re import fullmatch, findall from re import fullmatch, findall
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib as mpl import matplotlib as mpl
from os.path import isdir from os.path import isdir
from datetime import datetime as dt from datetime import datetime as dt
from .database import t_request, t_user, t_file, t_filegroup, database_tables
from .sql_util import sanitize, sql_select, sql_exists, sql_insert, sql_tablesize, sql_get_count_where
""" """
visualize information from the databse visualize information from the databse
TODO: TODO:

View File

@ -13,7 +13,7 @@ setup(
license="GPLv3", license="GPLv3",
packages=["regina"], packages=["regina"],
install_requires=["sqlite3"], install_requires=[],
classifiers=[ classifiers=[
"Operating System :: POSIX :: Linux", "Operating System :: POSIX :: Linux",
@ -25,6 +25,6 @@ setup(
# scripts=["bin/nicole"], # scripts=["bin/nicole"],
entry_points={ entry_points={
"console_scripts": [ "regina=regina.main:main" ], "console_scripts": [ "regina=regina.regina:main" ],
}, },
) )