def by_name(script_name, plugins): """ Returns a CeaScript object by name. :parameter str script_name: The name of the script to return (e.g. "demand") :parameter List[CeaPlugin]: The list of plugins to include in the search. """ for script in list_scripts(plugins): # Convert script names that use "_" instead of "-" if script.name == script_name.replace("_", "-"): return script raise cea.ScriptNotFoundException('Invalid script name: %s' % script_name)
def by_name(script_name): for script in list_scripts(): if script.name == script_name: return script raise cea.ScriptNotFoundException('Invalid script name: %s' % script_name)