-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Both the file database and the key database are used throughout the app, and both depend on the output of the CommandValidator for instantiation.
Current approach
Both databases use this singleton decorator to make their instance available to all modules like this:
from FileDatabase import FileDatabase
FileDatabase().foo()Except in app.py, where it's defined like:
FILEDB = None
...
FILEDB = FileDatabase(data_dir)
Cons
We must be careful to instantiate the FileDatabase() with its parameters before any of these calls happen or we'll get a confusing error.
We reference the database in different ways in different modules.
Other approaches
Attach to tramestateobjectstate._filedb = FileDatabase(work_dir)throws error on attempting serialization- Inject databases into widgets that need them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels