@@ -380,7 +380,6 @@ def _run(self, i):
380
380
381
381
verbose = False
382
382
silent = False
383
-
384
383
if i .get ('verbose' , '' ) != '' :
385
384
verbose = True if is_true (i .get ('verbose' , '' )) else False
386
385
elif i .get ('v' , '' ) != '' :
@@ -402,14 +401,20 @@ def _run(self, i):
402
401
403
402
if silent :
404
403
env ['MLC_TMP_SILENT' ] = 'yes'
405
- logger .setLevel (logging .ERROR )
404
+ logger .setLevel (logging .WARNING )
406
405
run_state ['tmp_silent' ] = True
407
406
408
407
if verbose :
409
408
env ['MLC_TMP_VERBOSE' ] = 'yes'
410
409
run_state ['tmp_verbose' ] = True
411
410
logger .setLevel (logging .DEBUG )
412
411
412
+ if not env .get ('MLC_TMP_SILENT' ) and not env .get ('MLC_TMP_VERBOSE' ):
413
+ if logger .level == logging .DEBUG :
414
+ env ['MLC_TMP_VERBOSE' ] = "yes"
415
+ elif logger .level == logging .DEBUG :
416
+ env ['MLC_TMP_SILENT' ] = "yes"
417
+
413
418
print_deps = i .get ('print_deps' , False )
414
419
print_versions = i .get ('print_versions' , False )
415
420
print_readme = i .get ('print_readme' , False )
@@ -567,9 +572,6 @@ def _run(self, i):
567
572
x_variation_tags = ['_' + v for v in variation_tags ]
568
573
mlc_script_info += y .join (x_variation_tags )
569
574
570
- # if verbose:
571
- # logger.info('')
572
-
573
575
logger .info (recursion_spaces + '* ' + mlc_script_info )
574
576
575
577
#######################################################################
@@ -731,7 +733,6 @@ def _run(self, i):
731
733
False ,
732
734
script_tags_string ,
733
735
quiet ,
734
- verbose ,
735
736
logger )
736
737
737
738
# Remember selection
@@ -916,8 +917,7 @@ def _run(self, i):
916
917
new_state_keys_from_meta ,
917
918
add_deps_recursive ,
918
919
run_state ,
919
- recursion_spaces ,
920
- verbose )
920
+ recursion_spaces )
921
921
if r ['return' ] > 0 :
922
922
return r
923
923
@@ -1182,7 +1182,6 @@ def _run(self, i):
1182
1182
'skip_remembered_selections' : skip_remembered_selections ,
1183
1183
'remembered_selections' : remembered_selections ,
1184
1184
'quiet' : quiet ,
1185
- 'verbose' : verbose ,
1186
1185
'show_time' : show_time
1187
1186
})
1188
1187
if r ['return' ] > 0 :
@@ -1216,7 +1215,6 @@ def _run(self, i):
1216
1215
True ,
1217
1216
script_tags_string ,
1218
1217
quiet ,
1219
- verbose ,
1220
1218
logger )
1221
1219
1222
1220
if selection >= 0 :
@@ -1244,7 +1242,7 @@ def _run(self, i):
1244
1242
' - Checking dynamic dependencies on other MLC scripts:' )
1245
1243
r = self ._call_run_deps (deps , self .local_env_keys , local_env_keys_from_meta , env , state , const , const_state , add_deps_recursive ,
1246
1244
recursion_spaces + extra_recursion_spaces ,
1247
- remembered_selections , variation_tags_string , True , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1245
+ remembered_selections , variation_tags_string , True , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1248
1246
if r ['return' ] > 0 :
1249
1247
return r
1250
1248
@@ -1264,7 +1262,7 @@ def _run(self, i):
1264
1262
1265
1263
r = self ._call_run_deps (prehook_deps , self .local_env_keys , local_env_keys_from_meta , env , state , const , const_state , add_deps_recursive ,
1266
1264
recursion_spaces + extra_recursion_spaces ,
1267
- remembered_selections , variation_tags_string , True , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1265
+ remembered_selections , variation_tags_string , True , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1268
1266
if r ['return' ] > 0 :
1269
1267
return r
1270
1268
@@ -1327,7 +1325,7 @@ def _run(self, i):
1327
1325
1328
1326
r = self ._call_run_deps (posthook_deps , self .local_env_keys , clean_env_keys_post_deps , env , state , const , const_state , add_deps_recursive ,
1329
1327
recursion_spaces + extra_recursion_spaces ,
1330
- remembered_selections , variation_tags_string , True , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1328
+ remembered_selections , variation_tags_string , True , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1331
1329
if r ['return' ] > 0 :
1332
1330
return r
1333
1331
@@ -1338,7 +1336,7 @@ def _run(self, i):
1338
1336
# Check chain of post dependencies on other MLC scripts
1339
1337
r = self ._call_run_deps (post_deps , self .local_env_keys , clean_env_keys_post_deps , env , state , const , const_state , add_deps_recursive ,
1340
1338
recursion_spaces + extra_recursion_spaces ,
1341
- remembered_selections , variation_tags_string , True , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1339
+ remembered_selections , variation_tags_string , True , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1342
1340
if r ['return' ] > 0 :
1343
1341
return r
1344
1342
@@ -1545,7 +1543,7 @@ def _run(self, i):
1545
1543
1546
1544
r = self ._call_run_deps (docker_deps , self .local_env_keys , local_env_keys_from_meta , env , state , const , const_state , add_deps_recursive ,
1547
1545
recursion_spaces + extra_recursion_spaces ,
1548
- remembered_selections , variation_tags_string , False , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1546
+ remembered_selections , variation_tags_string , False , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1549
1547
if r ['return' ] > 0 :
1550
1548
return r
1551
1549
@@ -1582,7 +1580,6 @@ def _run(self, i):
1582
1580
'variation_tags_string' : variation_tags_string ,
1583
1581
'found_cached' : False ,
1584
1582
'debug_script_tags' : debug_script_tags ,
1585
- 'verbose' : verbose ,
1586
1583
'meta' : meta ,
1587
1584
'self' : self
1588
1585
}
@@ -1643,7 +1640,7 @@ def _run(self, i):
1643
1640
1644
1641
r = self ._call_run_deps (deps , self .local_env_keys , local_env_keys_from_meta , env , state , const , const_state , add_deps_recursive ,
1645
1642
recursion_spaces + extra_recursion_spaces ,
1646
- remembered_selections , variation_tags_string , False , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1643
+ remembered_selections , variation_tags_string , False , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1647
1644
if r ['return' ] > 0 :
1648
1645
return r
1649
1646
@@ -1686,7 +1683,6 @@ def _run(self, i):
1686
1683
'variation_tags_string': variation_tags_string,
1687
1684
'found_cached': False,
1688
1685
'debug_script_tags': debug_script_tags,
1689
- 'verbose': verbose,
1690
1686
'meta': meta,
1691
1687
'self': self
1692
1688
}
@@ -1859,7 +1855,7 @@ def _run(self, i):
1859
1855
1860
1856
r = self ._call_run_deps (prehook_deps , self .local_env_keys , local_env_keys_from_meta , env , state , const , const_state , add_deps_recursive ,
1861
1857
recursion_spaces + extra_recursion_spaces ,
1862
- remembered_selections , variation_tags_string , found_cached , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1858
+ remembered_selections , variation_tags_string , found_cached , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1863
1859
if r ['return' ] > 0 :
1864
1860
return r
1865
1861
@@ -1902,7 +1898,7 @@ def _run(self, i):
1902
1898
'clean_env_keys_post_deps' , [])
1903
1899
1904
1900
r = self ._run_deps (post_deps , clean_env_keys_post_deps , env , state , const , const_state , add_deps_recursive , recursion_spaces ,
1905
- remembered_selections , variation_tags_string , found_cached , debug_script_tags , verbose , show_time , extra_recursion_spaces , run_state )
1901
+ remembered_selections , variation_tags_string , found_cached , debug_script_tags , show_time , extra_recursion_spaces , run_state )
1906
1902
if r ['return' ] > 0 :
1907
1903
return r
1908
1904
@@ -2181,7 +2177,7 @@ def _run(self, i):
2181
2177
f .write (readme )
2182
2178
2183
2179
if dump_version_info :
2184
- r = self ._dump_version_info_for_script (quiet = quiet , silent = silent )
2180
+ r = self ._dump_version_info_for_script (quiet = quiet )
2185
2181
if r ['return' ] > 0 :
2186
2182
return r
2187
2183
@@ -2231,17 +2227,16 @@ def _run(self, i):
2231
2227
' - used disk space: {} MB' .format (used_disk_space_in_mb ))
2232
2228
2233
2229
# Check if need to print some final info such as path to model, etc
2234
- if not run_state .get ('tmp_silent' , False ):
2235
- print_env_at_the_end = meta .get ('print_env_at_the_end' , {})
2236
- if len (print_env_at_the_end ) > 0 :
2237
- for p in sorted (print_env_at_the_end ):
2238
- t = print_env_at_the_end [p ]
2239
- if t == '' :
2240
- t = 'ENV[{}]' .format (p )
2230
+ print_env_at_the_end = meta .get ('print_env_at_the_end' , {})
2231
+ if len (print_env_at_the_end ) > 0 :
2232
+ for p in sorted (print_env_at_the_end ):
2233
+ t = print_env_at_the_end [p ]
2234
+ if t == '' :
2235
+ t = 'ENV[{}]' .format (p )
2241
2236
2242
- v = new_env .get (p , None )
2237
+ v = new_env .get (p , None )
2243
2238
2244
- logger .info ('{}: {}' .format (t , str (v )))
2239
+ logger .info ('{}: {}' .format (t , str (v )))
2245
2240
2246
2241
# Check if print nice versions
2247
2242
if print_versions :
@@ -2327,12 +2322,11 @@ def _fix_cache_paths(self, env):
2327
2322
2328
2323
##########################################################################
2329
2324
def _dump_version_info_for_script (
2330
- self , output_dir = os .getcwd (), quiet = False , silent = False ):
2325
+ self , output_dir = os .getcwd (), quiet = False ):
2331
2326
logger = self .action_object .logger
2332
- if not quiet and not silent :
2333
- pass
2334
2327
for f in ['mlc-run-script-versions.json' , 'version_info.json' ]:
2335
- logger .info ('Dumping versions to {}' .format (f ))
2328
+ if not quiet :
2329
+ logger .info ('Dumping versions to {}' .format (f ))
2336
2330
r = utils .save_json (f , self .run_state .get ('version_info' , []))
2337
2331
if r ['return' ] > 0 :
2338
2332
return r
@@ -2341,7 +2335,7 @@ def _dump_version_info_for_script(
2341
2335
2342
2336
##########################################################################
2343
2337
def _update_state_from_variations (self , i , meta , variation_tags , variations , env , state , const , const_state , deps , post_deps , prehook_deps ,
2344
- posthook_deps , new_env_keys_from_meta , new_state_keys_from_meta , add_deps_recursive , run_state , recursion_spaces , verbose ):
2338
+ posthook_deps , new_env_keys_from_meta , new_state_keys_from_meta , add_deps_recursive , run_state , recursion_spaces ):
2345
2339
2346
2340
logger = self .action_object .logger
2347
2341
# Save current explicit variations
@@ -3303,7 +3297,7 @@ def _process_variation_tags_in_groups(
3303
3297
3304
3298
def _call_run_deps (script , deps , local_env_keys , local_env_keys_from_meta , env , state , const , const_state ,
3305
3299
add_deps_recursive , recursion_spaces , remembered_selections , variation_tags_string , found_cached , debug_script_tags = '' ,
3306
- verbose = False , show_time = False , extra_recursion_spaces = ' ' , run_state = {'deps' : [], 'fake_deps' : [], 'parent' : None }):
3300
+ show_time = False , extra_recursion_spaces = ' ' , run_state = {'deps' : [], 'fake_deps' : [], 'parent' : None }):
3307
3301
if len (deps ) == 0 :
3308
3302
return {'return' : 0 }
3309
3303
@@ -3317,8 +3311,8 @@ def _call_run_deps(script, deps, local_env_keys, local_env_keys_from_meta, env,
3317
3311
local_env_keys += local_env_keys_from_meta
3318
3312
3319
3313
r = script ._run_deps (deps , local_env_keys , env , state , const , const_state , add_deps_recursive , recursion_spaces ,
3320
- remembered_selections , variation_tags_string , found_cached , debug_script_tags ,
3321
- verbose , show_time , extra_recursion_spaces , run_state )
3314
+ remembered_selections , variation_tags_string , found_cached , debug_script_tags ,
3315
+ show_time , extra_recursion_spaces , run_state )
3322
3316
if r ['return' ] > 0 :
3323
3317
return r
3324
3318
@@ -3327,7 +3321,7 @@ def _call_run_deps(script, deps, local_env_keys, local_env_keys_from_meta, env,
3327
3321
##########################################################################
3328
3322
def _run_deps (self , deps , clean_env_keys_deps , env , state , const , const_state , add_deps_recursive , recursion_spaces ,
3329
3323
remembered_selections , variation_tags_string = '' , from_cache = False , debug_script_tags = '' ,
3330
- verbose = False , show_time = False , extra_recursion_spaces = ' ' , run_state = {'deps' : [], 'fake_deps' : [], 'parent' : None }):
3324
+ show_time = False , extra_recursion_spaces = ' ' , run_state = {'deps' : [], 'fake_deps' : [], 'parent' : None }):
3331
3325
"""
3332
3326
Runs all the enabled dependencies and pass them env minus local env
3333
3327
"""
@@ -3470,8 +3464,6 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a
3470
3464
'const_state' : copy .deepcopy (const_state ),
3471
3465
'add_deps_recursive' : add_deps_recursive ,
3472
3466
'debug_script_tags' : debug_script_tags ,
3473
- 'verbose' : verbose ,
3474
- 'silent' : run_state .get ('tmp_silent' , False ),
3475
3467
'time' : show_time ,
3476
3468
'run_state' : run_state_copy
3477
3469
@@ -3764,10 +3756,6 @@ def find_file_in_paths(self, i):
3764
3756
logger = self .action_object .logger
3765
3757
hook = i .get ('hook' , None )
3766
3758
3767
- verbose = i .get ('verbose' , False )
3768
- if not verbose :
3769
- verbose = i .get ('v' , False )
3770
-
3771
3759
file_name = i .get ('file_name' , '' )
3772
3760
file_name_re = i .get ('file_name_re' , '' )
3773
3761
file_is_re = False
@@ -5019,9 +5007,6 @@ def prepare_and_run_script_with_postprocessing(i, postprocess="postprocess"):
5019
5007
state = i .get ('state' , {})
5020
5008
const_state = i .get ('const_state' , {})
5021
5009
run_state = i .get ('run_state' , {})
5022
- verbose = i .get ('verbose' , False )
5023
- if not verbose :
5024
- verbose = i .get ('v' , False )
5025
5010
5026
5011
show_time = i .get ('time' , False )
5027
5012
logger = i ['self' ].action_object .logger
@@ -5275,25 +5260,25 @@ def prepare_and_run_script_with_postprocessing(i, postprocess="postprocess"):
5275
5260
5276
5261
if len (posthook_deps ) > 0 and (postprocess == "postprocess" ):
5277
5262
r = script_automation ._call_run_deps (posthook_deps , local_env_keys , local_env_keys_from_meta , env , state , const , const_state ,
5278
- add_deps_recursive , recursion_spaces , remembered_selections , variation_tags_string , found_cached , debug_script_tags , verbose , show_time , ' ' , run_state )
5263
+ add_deps_recursive , recursion_spaces , remembered_selections , variation_tags_string , found_cached , debug_script_tags , show_time , ' ' , run_state )
5279
5264
if r ['return' ] > 0 :
5280
5265
return r
5281
5266
5282
5267
if (postprocess == "postprocess" ) and customize_code is not None and 'postprocess' in dir (
5283
5268
customize_code ):
5284
5269
rr = run_postprocess (customize_code , customize_common_input , recursion_spaces , env , state , const ,
5285
- const_state , meta , verbose , i ) # i as run_script_input
5270
+ const_state , meta , i ) # i as run_script_input
5286
5271
elif (postprocess == "detect_version" ) and customize_code is not None and 'detect_version' in dir (customize_code ):
5287
5272
rr = run_detect_version (customize_code , customize_common_input , recursion_spaces , env , state , const ,
5288
- const_state , meta , verbose )
5273
+ const_state , meta )
5289
5274
5290
5275
return rr
5291
5276
5292
5277
##############################################################################
5293
5278
5294
5279
5295
5280
def run_detect_version (customize_code , customize_common_input ,
5296
- recursion_spaces , env , state , const , const_state , meta , verbose = False ):
5281
+ recursion_spaces , env , state , const , const_state , meta ):
5297
5282
5298
5283
if customize_code is not None and 'detect_version' in dir (customize_code ):
5299
5284
import copy
@@ -5324,7 +5309,7 @@ def run_detect_version(customize_code, customize_common_input,
5324
5309
5325
5310
5326
5311
def run_postprocess (customize_code , customize_common_input , recursion_spaces ,
5327
- env , state , const , const_state , meta , verbose = False , run_script_input = None ):
5312
+ env , state , const , const_state , meta , run_script_input = None ):
5328
5313
5329
5314
if customize_code is not None and 'postprocess' in dir (customize_code ):
5330
5315
import copy
@@ -5962,7 +5947,7 @@ def detect_state_diff(env, saved_env, new_env_keys,
5962
5947
5963
5948
5964
5949
def select_script_item (lst , text , recursion_spaces ,
5965
- can_skip , script_tags_string , quiet , verbose , logger = None ):
5950
+ can_skip , script_tags_string , quiet , logger = None ):
5966
5951
"""
5967
5952
Internal: select script
5968
5953
"""
0 commit comments