Class ModuleLibrary
java.lang.Object
com.inductiveautomation.ignition.common.script.ModuleLibrary
Class for project resource Python script libraries
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final ModuleLibrary.ScriptHintScope
static final String
static final String
static final String
static final String
static final Pattern
static final ResourceType
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getScope
(ProjectResource resource) static void
install
(Project project, ScriptManager manager) static void
install
(List<ProjectResource> scripts, ScriptManager manager) static Consumer<ProjectResourceBuilder>
serializeScript
(String script, ModuleLibrary.ScriptHintScope scope) 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.static boolean
validatePackageName
(org.python.core.PyStringMap modules, ResourcePath destination, String newValue) Checks whether a given name is legal to be inserted at the target location.
-
Field Details
-
MODULE_ID
- See Also:
-
RESOURCE_TYPE
-
SCOPE
public static final int SCOPE- See Also:
-
CODE_DATA_KEY
- See Also:
-
LEGACY_SHARED_MODULE
- See Also:
-
LEGACY_PROJECT_MODULE
- See Also:
-
HINT_SCOPE_KEY
- See Also:
-
DEFAULT_HINT_SCOPE
-
NAME_PATTERN
-
-
Method Details
-
install
-
install
-
deserializeScript
-
serializeScript
public static Consumer<ProjectResourceBuilder> serializeScript(String script, ModuleLibrary.ScriptHintScope scope) -
getScope
-
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; seeScriptManager.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
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.
-