You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't particularly like the way data is loaded by the level wrapper classes.
Currently in the __init__ function they load the root data so that it can be queried.
This means that if the level does not exist it tries and fails to load that data.
Feature Description
It would make more sense if the __init__ function simply initialised variables to their default state and did not actually load any data.
There would be a public method (perhaps load_root) that would load this data.
This would mean that the full subclass chain of __init__ can run without worrying if the subclass default attribute has been set.
It also does not having to try and except loading the data.
Once the class has been initialised the calling code can call load_root to make the root data available for inspection or just open which would load the root data and open the database for editing. Alternatively create_and_open could be called to initialise the data and open it.
Edit: load_metadata might be a better name
The text was updated successfully, but these errors were encountered:
The Problem
I don't particularly like the way data is loaded by the level wrapper classes.
Currently in the
__init__
function they load the root data so that it can be queried.This means that if the level does not exist it tries and fails to load that data.
Feature Description
It would make more sense if the
__init__
function simply initialised variables to their default state and did not actually load any data.There would be a public method (perhaps
load_root
) that would load this data.This would mean that the full subclass chain of
__init__
can run without worrying if the subclass default attribute has been set.It also does not having to try and except loading the data.
Once the class has been initialised the calling code can call
load_root
to make the root data available for inspection or justopen
which would load the root data and open the database for editing. Alternativelycreate_and_open
could be called to initialise the data and open it.Edit:
load_metadata
might be a better nameThe text was updated successfully, but these errors were encountered: