66
77namespace eval ::write {
88 Kratos::AddNamespace [namespace current]
9-
9+
1010 variable mat_dict
1111 variable submodelparts
1212 variable MDPA_loop_control
@@ -38,7 +38,7 @@ proc write::Init { } {
3838
3939 set current_mdpa_indent_level 0
4040
41-
41+
4242 variable formats_dict
4343 set formats_dict [dict create]
4444 variable properties_exclusion_list
@@ -103,7 +103,7 @@ proc write::writeEvent { filename } {
103103 return 1
104104 }
105105 set inittime [clock seconds]
106-
106+
107107 # Set write formats depending on the user's configuration
108108 InitWriteFormats
109109
@@ -144,7 +144,7 @@ proc write::writeEvent { filename } {
144144 if {$time_monitor } {
145145 W " Total time: [ Kratos::Duration $ttime ] "
146146 }
147-
147+
148148 # ### Copy main script file ####
149149 if {$errcode eq 0} {
150150 Kratos::Log " Write custom event $appid "
@@ -153,7 +153,7 @@ proc write::writeEvent { filename } {
153153
154154 # ### Debug files for VSCode ####
155155 write::writeLaunchJSONFile
156-
156+
157157 Kratos::Log " Write end $appid in [ Kratos::Duration $ttime ] "
158158 return $errcode
159159}
@@ -680,8 +680,10 @@ proc write::CopyMainScriptFile { } {
680680 # Main python script
681681 if {[catch {
682682 set orig_name [write::GetConfigurationAttribute main_launch_file]
683- write::CopyFileIntoModel $orig_name
684- write::RenameFileInModel [file tail $orig_name ] " MainKratos.py"
683+ if {$orig_name ne " " } {
684+ write::CopyFileIntoModel $orig_name
685+ write::RenameFileInModel [file tail $orig_name ] " MainKratos.py"
686+ }
685687 } fid] } {
686688 W " Problem Writing $errName block:\n $fid \n Event $wevent \n End problems"
687689 return errcode 1
0 commit comments