Skip to content

Commit

Permalink
Merge pull request #53 from opengisch/usabilityhub_dir
Browse files Browse the repository at this point in the history
Workaround to add the usabilityhub repository when a metaconfig is passed to ili2db
  • Loading branch information
signedav authored Feb 15, 2023
2 parents 79525e8 + 78462e7 commit 6ac2463
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modelbaker/iliwrapper/ili2dbconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def restore(self, settings):
self.debugging_enabled = settings.value("DebuggingEnabled", False, bool)
self.logfile_path = settings.value("LogfilePath", "", str)

def to_ili2db_args(self, with_modeldir=True):
def to_ili2db_args(self, with_modeldir=True, with_usabilityhub_repo=False):
"""
Create an ili2db command line argument string from this configuration
"""
Expand All @@ -73,6 +73,11 @@ def to_ili2db_args(self, with_modeldir=True):
]
str_model_directories = ";".join(str_model_directories)
args += ["--modeldir", str_model_directories]
if with_usabilityhub_repo:
if not self.custom_model_directories_enabled:
# Workaround for https://github.com/opengisch/QgisModelBaker/issues/784.
# Can be removed when ili2db has access to the UsabILIty Hub repository.
args += ["--modeldir", "https://models.opengis.ch/"]
if self.debugging_enabled and self.logfile_path:
args += ["--trace"]
args += ["--log", self.logfile_path]
Expand Down Expand Up @@ -146,7 +151,9 @@ def to_ili2db_args(self):
# Valid ili file, don't pass --modeldir (it can cause ili2db errors)
with_modeldir = not self.ilifile

args = self.base_configuration.to_ili2db_args(with_modeldir=with_modeldir)
args = self.base_configuration.to_ili2db_args(
with_modeldir=with_modeldir, with_usabilityhub_repo=bool(self.metaconfig_id)
)

proxy = QgsNetworkAccessManager.instance().fallbackProxy()
if proxy.type() == QNetworkProxy.HttpProxy:
Expand Down

0 comments on commit 6ac2463

Please sign in to comment.