Use relative imports

This commit is contained in:
Kumi 2022-08-08 10:03:51 +00:00
parent f2c5753cc1
commit 74927c9d02
Signed by: kumi
GPG key ID: ECBCC9082395383F
8 changed files with 9 additions and 27 deletions

View file

@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "reportmonster"
version = "0.9.1"
version = "0.9.2"
authors = [
{ name="Kumi Systems e.U.", email="office@kumi.systems" },
]

View file

@ -3,8 +3,8 @@ import configparser
from pathlib import Path
from typing import Union
from classes.vessel import Vessel
from classes.user import User
from .vessel import Vessel
from .user import User
class MonsterConfig:

View file

@ -3,7 +3,7 @@ import MySQLdb.cursors
from typing import Union, Optional
from classes.connection import Connection
from .connection import Connection
class Database:

View file

@ -1,4 +1,5 @@
from classes.database import Database
from .database import Database
from ..const import *
from configparser import SectionProxy
from typing import Optional, Union
@ -7,8 +8,6 @@ from datetime import datetime
from MySQLdb.cursors import DictCursor
from bcrypt import hashpw, gensalt
from const import *
class User:
"""Class describing a User

View file

@ -1,4 +1,5 @@
from classes.database import Database
from .database import Database
from ..const import *
from configparser import SectionProxy
from typing import Optional, Union
@ -7,8 +8,6 @@ from datetime import datetime
from MySQLdb.cursors import DictCursor
from bcrypt import hashpw, gensalt
from const import *
class Vessel:
"""Class describing a Vessel

View file

@ -1,16 +0,0 @@
import argparse
import importlib
import sys
parser = argparse.ArgumentParser(description='Run a specified report')
parser.add_argument('report') #, type=str, help='name of the report to execute')
args = parser.parse_args()
sys.argv = sys.argv[1:]
try:
importlib.import_module("reports.%s" % args.report)
except ImportError as e:
print("Error: Could not import %s: %s" % (args.report, str(e)))

View file

@ -5,7 +5,7 @@ import time
import pathlib
import json
from classes.config import MonsterConfig
from .classes.config import MonsterConfig
class ReportMonsterHandler(socketserver.BaseRequestHandler):