Skip to content

Commit

Permalink
[ili2db] Add ili2db's exportMetaConfig operation (available since ili…
Browse files Browse the repository at this point in the history
…2db v5.2.0) to get all parameters used in the schema import operation exported to a single file
  • Loading branch information
gacarrillor committed Nov 20, 2024
1 parent 3929f37 commit 96b0f46
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
20 changes: 20 additions & 0 deletions modelbaker/iliwrapper/ili2dbconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,23 @@ def to_ili2db_args(self, extra_args=[], with_action=True):
self.append_args(args, Ili2DbCommandConfiguration.to_ili2db_args(self))

return args


class ExportMetaConfigConfiguration(Ili2DbCommandConfiguration):
def __init__(self, other: Ili2DbCommandConfiguration = None):
super().__init__(other)
self.metaconfigoutputfile = ""

def to_ili2db_args(self, extra_args=[], with_action=True):
args = list()

if with_action:
self.append_args(args, ["--exportMetaConfig"])

self.append_args(args, extra_args)

self.append_args(args, ["--metaConfig", self.metaconfigoutputfile])

self.append_args(args, Ili2DbCommandConfiguration.to_ili2db_args(self))

return args
2 changes: 1 addition & 1 deletion modelbaker/iliwrapper/iliexecutable.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class IliExecutable(QObject, metaclass=AbstractQObjectMeta):
process_finished = pyqtSignal(int, int)
cancel_process = pyqtSignal()

__done_pattern = re.compile(r"Info: \.\.\.([a-z]+ )?done")
__done_pattern = re.compile(r"Info: \.\.\.([a-zA-Z]+ )?done")
__result = None

def __init__(self, parent=None):
Expand Down
32 changes: 32 additions & 0 deletions modelbaker/iliwrapper/ilimetaconfigexporter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
/***************************************************************************
-------------------
begin : 20/11/24
git sha : :%H$
copyright : (C) 2024 by Germán Carrillo
email : german@opengis.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from .ili2dbconfig import ExportMetaConfigConfiguration, Ili2DbCommandConfiguration
from .iliexecutable import IliExecutable


class MetaConfigExporter(IliExecutable):
def __init__(self, parent=None):
super().__init__(parent)
self.version = 4

def _create_config(self) -> Ili2DbCommandConfiguration:
return ExportMetaConfigConfiguration()

def _get_ili2db_version(self):
return self.version

0 comments on commit 96b0f46

Please sign in to comment.