(all_modules, config=None)
Add custom modules to all_modules
Add custom modules to all_modules
Add custom modules to all_modules
def add_custom_modules(all_modules, config=None):
  """Add custom modules to all_modules"""
  current_work_dir = os.getcwd()
  if current_work_dir not in sys.path:
    sys.path.append(current_work_dir)
  if config is not None and "custom_modules" in config:
    custom_modules = config["custom_modules"]
    if not isinstance(custom_modules, list):
      custom_modules = [custom_modules]
    all_modules += [
        ("", [path_to_module_format(module)]) for module in custom_modules
    ]
def add_custom_modules ( all_modules , config = None ) : current_work_dir = os . getcwd ( ) if current_work_dir not in sys . path : sys . path . append ( current_work_dir ) if config is not None and "custom_modules" in config : custom_modules = config [ "custom_modules" ] if not isinstance ( custom_modules , list ) : custom_modules = [ custom_modules ] all_modules += [ ( "" , [ path_to_module_format ( module ) ] ) for module in custom_modules ]