File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/dcore/sumkdft_workers Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 14
14
args = parser .parse_args ()
15
15
16
16
# Runner class
17
- m = importlib .import_module ('dcore.sumkdft_workers.all_workers' )
18
- cls = getattr (m , args .runner_cls )
17
+ m_cls = args .runner_cls .split ('.' )
18
+ if len (m_cls ) == 1 :
19
+ m = importlib .import_module ('dcore.sumkdft_workers.all_workers' )
20
+ cls = getattr (m , args .runner_cls )
21
+ else :
22
+ m = importlib .import_module ('.' .join (m_cls [:- 1 ]))
23
+ cls = getattr (m , m_cls [- 1 ])
19
24
runner = cls (args .model_hdf5_file , args .input_file , args .output_file )
20
25
runner .run ()
21
-
26
+ except ImportError as e :
27
+ print ("Import error:" , e )
28
+ import traceback
29
+ traceback .print_exc ()
30
+ sys .exit (1 )
22
31
23
32
except Exception as e :
24
33
print ("Unexpected error:" , e )
You can’t perform that action at this time.
0 commit comments