Class ModuleLibrary

java.lang.Object
com.inductiveautomation.ignition.common.script.ModuleLibrary

public class ModuleLibrary extends Object
Class for project resource Python script libraries
  • Field Details

  • Method Details

    • install

      public static void install(ResourceCollection project, ScriptManager manager)
    • install

      public static void install(List<Resource> scripts, ScriptManager manager)
    • deserializeScript

      public static String deserializeScript(Resource r)
    • serializeScript

      public static Consumer<ResourceBuilder> serializeScript(String script, ModuleLibrary.ScriptHintScope scope)
    • getScope

      public static ModuleLibrary.ScriptHintScope getScope(Resource resource)
    • validatePackageName

      public static boolean validatePackageName(@Nonnull org.python.core.PyStringMap modules, @Nonnull ResourcePath destination, @Nonnull String newValue)
      Checks whether a given name is legal to be inserted at the target location.
      Parameters:
      modules - The modules installed in the relevant context' ScriptManager; see ScriptManager.getModules()
      destination - The path where this resource will be inserted. Used to check for sibling conflicts.
      newValue - The actual name up for consideration.
      Returns:
      Whether the given name (at the given location) is legal to be inserted.
    • validateFullPath

      public static boolean validateFullPath(org.python.core.PyStringMap modules, StringPath fullPath)
      Validates a StringPath of potential package names (ending with a module name) to ensure all elements are legal names.
      Parameters:
      modules - The modules installed in the relevant context' ScriptManager; ScriptManager.getModules()
      fullPath - The StringPath to consider.
      Returns:
      true only if the full path sequence is valid.