Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
4b54b4c8
Commit
4b54b4c8
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#57 Docstring-endringer
parent
286ee097
No related branches found
Branches containing commit
No related tags found
1 merge request
!44
#57 Database: testmodus og bruk samme instans overalt
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
soitool/codebook.py
+1
-0
1 addition, 0 deletions
soitool/codebook.py
soitool/codebook_to_pdf.py
+2
-2
2 additions, 2 deletions
soitool/codebook_to_pdf.py
soitool/database.py
+3
-3
3 additions, 3 deletions
soitool/database.py
test/test_codebook_to_pdf.py
+4
-1
4 additions, 1 deletion
test/test_codebook_to_pdf.py
with
10 additions
and
6 deletions
soitool/codebook.py
+
1
−
0
View file @
4b54b4c8
...
...
@@ -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.
"""
...
...
This diff is collapsed.
Click to expand it.
soitool/codebook_to_pdf.py
+
2
−
2
View file @
4b54b4c8
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
soitool/database.py
+
3
−
3
View file @
4b54b4c8
...
...
@@ -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.
"""
...
...
This diff is collapsed.
Click to expand it.
test/test_codebook_to_pdf.py
+
4
−
1
View file @
4b54b4c8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment