Brightway has the ability to import project backup files (tarballs), either from a remote server or locally. We would like to add this to the AB.
I have started this work in the import-projectbranch but don't know Qt well enough to do this well or efficiently.
Local import
Modal window with the following:
File chooser from local filesystem widget
Option to specify to project name
Checkbox to overwrite existing project
Button to execute the import action
Upon selecting a file, the system should open it and look for a file called .project-name.json (see implementation code), and read the default project name.
Anytime editing is finished on the QLineEdit for the project name, either because it was populated from .project-name.json or manually by the user, we should check if the given project name is already in bw2data.projects. If it is, then the checkbox to overwrite existing project should be active (but not checked), and the button to execute the import action should be inactive until the checkbox is checked. Similarly, if the given project name does not exist locally, then the checkbox should be inactive, and the button can be clicked directly.
Remote import
What we currently have - this needs to be better
Modal window or wizard with two steps. First, to get the remote resource:
Line edit to specify the server url (default https://files.brightway.dev/)
Line edit to specify the catalogue filename (default projects-config.json)
Button to retrieve the catalogue data (runs once with default data on loading the widget)
Next (can be a separate wizard step or in the same window):
Option to specify to project name
Checkbox to overwrite existing project
Button to execute the import action
Logic flows the same as for the local import, overwrite only active if the project name overlaps.
Feature request
Brightway has the ability to import project backup files (tarballs), either from a remote server or locally. We would like to add this to the AB.
I have started this work in the
import-project
branch but don't know Qt well enough to do this well or efficiently.Local import
Modal window with the following:
Upon selecting a file, the system should open it and look for a file called
.project-name.json
(see implementation code), and read the default project name.Anytime editing is finished on the
QLineEdit
for the project name, either because it was populated from.project-name.json
or manually by the user, we should check if the given project name is already inbw2data.projects
. If it is, then the checkbox to overwrite existing project should be active (but not checked), and the button to execute the import action should be inactive until the checkbox is checked. Similarly, if the given project name does not exist locally, then the checkbox should be inactive, and the button can be clicked directly.Remote import
What we currently have - this needs to be better
Modal window or wizard with two steps. First, to get the remote resource:
https://files.brightway.dev/
)projects-config.json
)Next (can be a separate wizard step or in the same window):
Logic flows the same as for the local import, overwrite only active if the project name overlaps.