class
ScriptLibManObject.
LibManager
Bases: object
An instance implementing this interface is injected into the scriptengine scope under the name library manager.
property
repositories
Gets the list of available library repositories.
The order of those repositories is configurable by the user in the dialog and the script.
This list is a snapshot of the current state. When repositories are created, removed or moved, those changes are not reflected “live” in the list, and you need to get a fresh copy.
tuple[LibRepository]
The list of available repositories.
insert_repository
rootfolder
name
index=-1
Creates a new library repository.
rootfolder (str) – The rootfolder for the repository (this must be the full path to an existing directory on disk).
name (str) – The name of the repository.
index (int) – The index of the repository in the list. -1 means the repository is added to the end of the list.
The newly created repository.
move_repository
repository
new_index
Move_repositories the specified repository to a new position in the list.
Use this to manipulate the search order.
repository (LibRepository) – The repository.
new_index (int) – The new index. You can pass -1 to move it to the end of the list.
remove_repository
repository
delete_on_disk=False
Removes the specified repository.
repository (LibRepository) – The repository.
delete_on_disk (bool) – If set to True, the on-disk directory is also deleted.
update_repository
repository
new_name=None
new_location=None
copy_libraries=False
Update the specified repository.
repository (LibRepository) – The repository.
new_name (str) – The new name.
new_location (str) – The new location.
copy_libraries (bool) – if set to True, the libraries from the old location are installed at the new location, if they don’t exist.
get_file_path
library
Gets the file path of the specified library in the library repository.
library (ManagedLib) – The library.
str
The file path of the library.
property
categories
Gets all the known library categories.
tuple[LibCategory]
All the known library categories.
property
top_level_categories
Gets the all known top level library categories.
tuple[LibCategory]
All known top level library categories.
get_category
guid
Gets the category with the specified GUID.
install_library
filepath
repository=None
overwrite=False
Installs the library with the specified filepath.
filepath (str) – The filepath of the library to install.
repository (LibRepository) – The repository. This parameter is optional, if omitted, the first repository in the list is used.
overwrite (bool) – if set to True, existing libraries are replaced.
The installed library.
uninstall_library
repository
library
Uninstalls a library from the specified repository.
repository (LibRepository) – The repository.
library (ManagedLib) – The library.
get_library
name
repository
Gets all libraries with the specified name.
name (str) – The name.
repository (LibRepository) – The repository. If you pass None, all repositories are searched in order.
The found library.
get_all_libraries
exclude_shadowed_libs: bool = True
This override is used when parameter is of type bool.
Gets all libraries.
exclude_shadowed_libs (bool) – If set to True, shadowed libs are excluded.
tuple[ManagedLib]
find_library
display_name
Finds the library with the specified display_name.
display_name (str) – The display name to search for.
tuple [ManagedLib, LibRepository]
A python tuple containing the ManagedLib and the LibRepository, or None if nothing found.
class
ScriptLibManObject.
LibRepository
Bases: object
Description class for a library repository.
property
editable
Gets a value indicating whether this LibRepository is editable.
The default system library repository is not editable - that means, it cannot be removed from the list of repositories.
bool
True if editable, otherwise False.
property
name
Gets the name of the repository.
str
property
root_folder
Gets the root folder of the repository.
str
class
ScriptLibManObject.
ManagedLib
Bases: object
Description class for a managed library.
property
displayname
Display name.
str
property
company
Company.
str
property
title
Title.
str
property
version
Version.
Version
property
default_namespace
Default namespace.
str
property
dependencies
Gets the dependencies as a list of strings.
tuple[str]
property
categories
class
ScriptLibManObject.
LibCategory
Bases: object
Information about a library category.
property
guid
Gets the guid identifying the category.
Guid
property
parent
Gets the parent category, or None if the category is top level.
property
default_name
Gets the default name.
str
property
name
Gets the localized name, or the default name if no localized name is available.
str
property
localized_name
Gets the localized name for the current UI culture.
str
property
version
Version.
Version
class
ScriptLibManObject.
ScriptLibManObjectMarker
class
ScriptLibManObject.
ScriptLibManObject
Bases: ScriptLibManObjectMarker
Functionality for manipulating library managers.
All objects implementing LibManObject will be extended with this methods.
get_libraries
recursive=False
Returns a list of all libraries.
recursive (bool) – If set to True, sublibraries are also queried recursively.
list [str]
The list of library names.
add_library
library: ManagedLib
Adds a reference to the specified library.
library (ManagedLib) – The library (since V3.5.5.0).
add_placeholder
name: str
default_resolution: ManagedLib
Adds a placeholder with the specified default resolution.
name (str) – The name.
default_resolution (ManagedLib) – The default resolution (since V3.5.5.0).
remove_library
name
Removes the librariy with the specified name.
name (str) – The name.
property
references
Gets the collection of the references currently configured within this library manager.
3.5.5.0
class
ScriptLibManObject.
ScriptLibraryReferences
iterable=()
/
Bases: list
The references currently managed by the library manager.
class
ScriptLibManObject.
ScriptLibraryReference
Bases: object
A library reference in the library manager.
property
id
Id.
int
property
is_placeholder
Gets a value indicating whether this ScriptLibraryReference is a placeholder.
bool
True if it is a placeholder, otherwise False.
property
is_managed
Gets a value indicating whether this ScriptLibraryReference is a managed reference to a fixed library version.
bool
property
name
Gets the name of this library.
For managed items, this follows the pattern “Name, Version (Company)”. For placeholder items, this name follows the pattern “#Name”. See also: ScriptPlaceholderReference.placeholder_name.
str
property
namespace
Gets or sets the namespace for this library.
str
property
system_library
Gets a boolean value indicating whether this library is a system library or not.
System libraries have been added implicitly by plug-ins whereas non-system libraries have been explicitly added by the user.
bool
get_dependencies
Gets the dependencies of this library.
For libraries containing cyclic dependencies, this may lead to an endless recursion.
list[ScriptLibraryReference]
A list of dependencies.
property
parameters
Gets the library parameter set.
If a global variable list containing only constant values has the attribute ‘parameterlist’, its content may be modified in the referencing project using this mechanism.
property
hide_when_referenced_as_dependency
Gets or sets a value indicating whether this library node should be hidden in the user interface if it a direct or indirect dependency of a top-level library node.
bool
property
publish_symbols_in_container
Gets or sets the qualified-only flag.
If set, the name of the library is mandatory for any access to the library content.
The default is true.
bool
property
qualified_only
Gets or sets the qualified-only flag.
If set, the name of the library is mandatory for any access to the library content.
Defaults to True.
bool
property
optional
Gets or sets the optional flag.
Libraries which are optional are not reported to the user as missing if they do not exist.
bool
class
ScriptLibManObject.
ScriptManagedLibraryReference
Bases: ScriptLibraryReference
A managed library reference which points to a fixed version of the library.
ScriptLibraryReference.is_managed is true for those instances.
property
managed_library
Gets the managed library.
class
ScriptLibManObject.
ScriptPlaceholderReference
Bases: ScriptLibraryReference
A placeholder reference. :class`ScriptLibraryReference` instances with ScriptLibraryReference.is_placeholder == True implement this interface.
property
placeholder_name
Gets the name of the placeholder.
In contrast to ScriptLibraryReference.name, this name does not include the leading ‘#’ character.
str
property
default_resolution
Gets or sets the default resolution of the library.
str
property
effective_resolution
Effective resolution.
str
property
is_redirected
Gets a value indicating whether this ScriptPlaceholderReference is redirected.
bool
get_redirection
Gets the redirection setting for this library.
str
The redirection.
set_redirection
fixed_resolution=''
Sets the redirection for this library.
fixed_resolution (str) – The fixed resolution. Use None or an empty string to delete the redirection.
property
resolution_info
Gets a human readable information how this placeholder is resolved.
str
property
resolver_guid
Gets a machinable readable information how this placeholder is resolved.
Guid
class
ScriptLibManObject.
ScriptLibraryParameters
iterable=()
/
Bases: list
The library parameters interface. This is a sequence of the parameter names.
If a global variable list containing only constant values has the attribute ‘parameterlist’, its content may be modified in the referencing project using this mechanism.
class
ScriptLibManObject.
ScriptLibManObjectContainer
Bases: object
Projects and Application Objects are extended with this interface.
3.5.2.0
property
has_library_manager
Gets a value indicating whether this ScriptLibManObjectContainer has a library manager.
bool
True if there is a library manager, otherwise False.
get_library_manager
Gets the library manager for this application or project, implicitly creating one if none is existing yet.
The library manager object. (ScriptObject)