Skip to content
Snippets Groups Projects
Commit 4b54b4c8 authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#57 Docstring-endringer

parent 286ee097
No related branches found
No related tags found
1 merge request!44#57 Database: testmodus og bruk samme instans overalt
......@@ -22,6 +22,7 @@ class CodeBookTableView(QTableView):
Parameter 'database' should be an instance of soitool.database.Database,
and is used to create a QSqlDatabase from the database-file.
Raises RuntimeError if database does not open.
"""
......
......@@ -60,7 +60,7 @@ def generate_codebook_pdf(
Parameters
----------
database : soitool.database.Database
Reference to database-instance
Reference to database-instance.
small : bool, optional
Data is from full codebook if False (default),
from small codebook if True.
......@@ -139,7 +139,7 @@ def get_codebook_data(database, small=False):
Parameters
----------
database : soitool.database.Database
Reference to database-instance
Reference to database-instance.
small : bool
Retrieves full codebook if False (default), small codebook if True.
......
......@@ -6,7 +6,7 @@ from datetime import datetime
import soitool.coder
from soitool.enumerates import CodebookSort
# Set name and path to default (, future) database
# Set name and path to default (future) database
DBNAME = "database"
CURDIR = os.path.dirname(__file__)
DBPATH = os.path.join(CURDIR, DBNAME)
......@@ -33,9 +33,9 @@ LASTUPDATED = "CREATE TABLE LastUpdated(Timestamp DATETIME PRIMARY KEY)"
class Database:
"""Holds database-connection and related functions.
Connects to existing db if found, creates new db if not.
Uses default database unless parameter 'db_path', path to a database-file,
is given. Connects to existing db if found, creates new db if not.
If db is created, tables are created and filled.
Uses default database unless parameter 'db_path' is given.
Holds a QTimer that requests an update of CodeBook on every timeout.
"""
......
......@@ -6,7 +6,10 @@ from pathlib import Path
from datetime import datetime
from soitool import codebook_to_pdf
from soitool.database import Database
from test.test_database import TESTDBPATH
TESTDBNAME = "testDatabase"
SOITOOL_DIR = Path(__file__).parent.parent / "soitool"
TESTDBPATH = os.path.join(SOITOOL_DIR, TESTDBNAME)
SOITOOL_ROOT_PATH = Path(__file__).parent.parent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment