|
@@ -9,7 +9,7 @@ import config
|
|
|
|
|
|
cfg = config.config()
|
|
cfg = config.config()
|
|
report_dir = cfg.portal_dir + '\\System\\Report'
|
|
report_dir = cfg.portal_dir + '\\System\\Report'
|
|
-publish_dir = cfg.portal_dir + '\\daten'
|
|
|
|
|
|
+publish_dir = cfg.portal_dir + '\\Publish\\daten'
|
|
|
|
|
|
|
|
|
|
@plac.pos('config_file', '', type=str)
|
|
@plac.pos('config_file', '', type=str)
|
|
@@ -21,17 +21,18 @@ def portal(config_file='GAPS_neu'):
|
|
return
|
|
return
|
|
prepare_report_temp(config_file)
|
|
prepare_report_temp(config_file)
|
|
pub_dir = Path(f'{publish_dir}\\{config_file}')
|
|
pub_dir = Path(f'{publish_dir}\\{config_file}')
|
|
|
|
+ rep_dir = f'{report_dir}\\{config_file}'
|
|
if not pub_dir.exists():
|
|
if not pub_dir.exists():
|
|
pub_dir.mkdir()
|
|
pub_dir.mkdir()
|
|
|
|
|
|
with open(f'{cfg.log_dir}\\{config_file}.mac.log', 'w') as logfile:
|
|
with open(f'{cfg.log_dir}\\{config_file}.mac.log', 'w') as logfile:
|
|
- export_files('jpg', pub_dir, logfile)
|
|
|
|
- export_files('xls', pub_dir, logfile)
|
|
|
|
- export_files('pdf', pub_dir, logfile)
|
|
|
|
|
|
+ export_files('jpg', rep_dir, pub_dir, logfile)
|
|
|
|
+ export_files('xls', rep_dir, pub_dir, logfile)
|
|
|
|
+ export_files('pdf', rep_dir, pub_dir, logfile)
|
|
|
|
|
|
|
|
|
|
-def export_files(export_format, pub_dir, logfile):
|
|
|
|
- rep_dir = f'{report_dir}\\{export_format}'
|
|
|
|
|
|
+def export_files(export_format, rep_dir, pub_dir, logfile):
|
|
|
|
+ rep_dir = f'{rep_dir}\\{export_format}'
|
|
cmd = f'"{cfg.cognos_dir}\\runmac32.exe" "{cfg.tools_dir}\\publish-reports.mac" "{rep_dir}","{export_format}","{pub_dir}"'
|
|
cmd = f'"{cfg.cognos_dir}\\runmac32.exe" "{cfg.tools_dir}\\publish-reports.mac" "{rep_dir}","{export_format}","{pub_dir}"'
|
|
print(f"Exportiere '{rep_dir}' nach '{pub_dir}'...")
|
|
print(f"Exportiere '{rep_dir}' nach '{pub_dir}'...")
|
|
start = datetime.now().timestamp()
|
|
start = datetime.now().timestamp()
|