|  | 
| 7 | 7 | Copyright 2024 NeuroML contributors | 
| 8 | 8 | """ | 
| 9 | 9 | 
 | 
| 10 |  | - | 
| 11 | 10 | import inspect | 
| 12 | 11 | import logging | 
| 13 | 12 | import math | 
| @@ -107,9 +106,12 @@ def run_lems_with_jneuroml( | 
| 107 | 106 |         return False | 
| 108 | 107 | 
 | 
| 109 | 108 |     if load_saved_data: | 
| 110 |  | -        if verbose: logger.info( | 
| 111 |  | -            "Reloading data generated by: {}, plotting: {}".format(lems_file_name, plot) | 
| 112 |  | -        ) | 
|  | 109 | +        if verbose: | 
|  | 110 | +            logger.info( | 
|  | 111 | +                "Reloading data generated by: {}, plotting: {}".format( | 
|  | 112 | +                    lems_file_name, plot | 
|  | 113 | +                ) | 
|  | 114 | +            ) | 
| 113 | 115 |         return reload_saved_data( | 
| 114 | 116 |             lems_file_name, | 
| 115 | 117 |             base_dir=exec_in_dir, | 
| @@ -676,15 +678,15 @@ def _gui_string(nogui: bool) -> str: | 
| 676 | 678 | 
 | 
| 677 | 679 | 
 | 
| 678 | 680 | def _include_string( | 
| 679 |  | -    paths_to_include: typing.Union[str, typing.Tuple[str], typing.List[str]] | 
|  | 681 | +    paths_to_include: typing.Union[str, typing.Tuple[str], typing.List[str]], | 
| 680 | 682 | ) -> str: | 
| 681 | 683 |     """Convert a path or list of paths into an include string to be used by jnml. | 
| 682 | 684 |     :param paths_to_include: path or list or tuple of paths to be included | 
| 683 | 685 |     :type paths_to_include: str or list(str) or tuple(str) | 
| 684 | 686 |     :returns: include string to be used with jnml. | 
| 685 | 687 |     """ | 
| 686 | 688 |     if paths_to_include: | 
| 687 |  | -        if type(paths_to_include) is str: | 
|  | 689 | +        if isinstance(paths_to_include, str): | 
| 688 | 690 |             paths_to_include = [paths_to_include] | 
| 689 | 691 |     if type(paths_to_include) in (tuple, list): | 
| 690 | 692 |         result = " -I '%s'" % ":".join(paths_to_include) | 
| @@ -847,7 +849,7 @@ def run_jneuroml_with_realtime_output( | 
| 847 | 849 | 
 | 
| 848 | 850 |     except KeyboardInterrupt as e: | 
| 849 | 851 |         raise e | 
| 850 |  | -    except: | 
|  | 852 | +    except Exception: | 
| 851 | 853 |         logger.error("*** Execution of jnml has failed! ***") | 
| 852 | 854 |         logger.error("*** Command: %s ***" % command) | 
| 853 | 855 |         if exit_on_fail: | 
|  | 
0 commit comments