Skip to content

Commit

Permalink
fix QGEP/#726: export fails if there is a space in the path
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang committed Apr 19, 2022
1 parent a99abbc commit 668c7da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qgepqwat2ili/utils/ili2db.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,30 @@ def create_ili_schema(schema, model, log_path, recreate_schema=False):
logger.info(f"ILIDB SCHEMAIMPORT INTO {schema}...")
pgconf = get_pgconf()
exec_(
f'"{config.JAVA}" -jar {config.ILI2PG} --schemaimport --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --setupPgExt --createGeomIdx --createFk --createFkIdx --createTidCol --importTid --noSmartMapping --defaultSrsCode 2056 --log {log_path} --nameLang de {model}'
f'"{config.JAVA}" -jar "{config.ILI2PG}" --schemaimport --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --setupPgExt --createGeomIdx --createFk --createFkIdx --createTidCol --importTid --noSmartMapping --defaultSrsCode 2056 --log "{log_path}" --nameLang de {model}'
)


def validate_xtf_data(xtf_file, log_path):
logger.info("VALIDATING XTF DATA...")
exec_(f'"{config.JAVA}" -jar {config.ILIVALIDATOR} --modeldir {config.ILI_FOLDER} --log {log_path} {xtf_file}')
exec_(
f'"{config.JAVA}" -jar "{config.ILIVALIDATOR}" --modeldir "{config.ILI_FOLDER}" --log "{log_path}" "{xtf_file}"'
)


def import_xtf_data(schema, xtf_file, log_path):
logger.info("IMPORTING XTF DATA...")
pgconf = get_pgconf()
exec_(
f'"{config.JAVA}" -jar {config.ILI2PG} --import --deleteData --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --modeldir {config.ILI_FOLDER} --disableValidation --skipReferenceErrors --createTidCol --noSmartMapping --defaultSrsCode 2056 --log {log_path} {xtf_file}'
f'"{config.JAVA}" -jar "{config.ILI2PG}" --import --deleteData --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --modeldir "{config.ILI_FOLDER}" --disableValidation --skipReferenceErrors --createTidCol --noSmartMapping --defaultSrsCode 2056 --log "{log_path}" "{xtf_file}"'
)


def export_xtf_data(schema, model_name, xtf_file, log_path):
logger.info("EXPORT ILIDB...")
pgconf = get_pgconf()
exec_(
f'"{config.JAVA}" -jar {config.ILI2PG} --export --models {model_name} --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --modeldir {config.ILI_FOLDER} --disableValidation --skipReferenceErrors --createTidCol --noSmartMapping --defaultSrsCode 2056 --log {log_path} --trace {xtf_file}'
f'"{config.JAVA}" -jar "{config.ILI2PG}" --export --models {model_name} --dbhost {pgconf["host"]} --dbport {pgconf["port"]} --dbusr {pgconf["user"]} --dbpwd {pgconf["password"]} --dbdatabase {pgconf["dbname"]} --dbschema {schema} --modeldir "{config.ILI_FOLDER}" --disableValidation --skipReferenceErrors --createTidCol --noSmartMapping --defaultSrsCode 2056 --log "{log_path}" --trace "{xtf_file}"'
)


Expand Down

0 comments on commit 668c7da

Please sign in to comment.