Package autodesk_toxik :: Module admin
[frames] | no frames]

Module admin

Administration module.

This module provides hooks to create and modify Toxik project, user and machine preferences. It also provides access and search mechanisms for Toxik components (compositions, composition versions, etc) through a virtual file system: the library manager.

Project, User and Machine Management

Toxik has three types of administrable that defines preferences used in the application: Project (".txproject" file), User (".txuser" file) and Machine (".txmachine" file), which all derive from a common base class: Administrable.

Those administrables are managed through their respective manager class: ProjectMgr, UserMgr and MachineMgr (even though they share a common interface, there is no base class for those manager classes).

Classes
  AdminError
  Administrable
The Project, User and Machine classes all derive from the Administrable base class.
  FindUtil
The FindUtil class can be used to perform search queries in the Toxik library.
  LibraryMgr
The library manager is a static class used to access and manage Toxik and regular files on the filesystem.
  Machine
  MachineMgr
For projects, users and machines (administrables) a common interface is implemented by their respective manager classes: ProjectMgr, UserMgr and MachineMgr.
  Project
The Project class provides additional methods to access its preferences.
  ProjectMgr
The manager class for Project administrables has a slightly different interface than the manager class for User and Machine administrables.
  UdaMgr
Use this class to manipulate user-defined attributes (UDAs).
  User
  UserMgr
For projects, users and machines (administrables) a common interface is implemented by their respective manager classes: ProjectMgr, UserMgr and MachineMgr.
Functions
str
getAbsolutePath(path)
Returns: The absolute path of a file for the given relative (or absolute) path.
str
statStr(libmgr, path)
Returns: A string representation of the output of stat for printout.
 
setUDA(componentPath, udaName, udaValue)
Convenience function that creates a UDA if it doesn't exist in the current project and sets its value on the specified component.
str
getCurrentDir(...)
Returns: The current working directory of the process.
str
getHomeDir(...)
Returns: The home directory is a directory under which Toxik stores data on a per user basis, and under which the Toxik user data directory will be created.
str
getInstallDir(...)
Returns: The installation directory.
str
getLogFile(...)
Returns: The file name for the log file of the current process.
str
getOutputDir(...)
Returns: The directory under which Toxik stores log files and other run-time information.
str
getPythonExec(...)
Returns: The python executable.
str
getResourcesDir(...)
Returns: The resources directory is where the Toxik runtime resource files reside.
str
getRootDir(...)
Returns: The root directory (str) of the file system (/ on UNIX or the current drive on Windows).
str
getScriptsDir(...)
Returns: The path to the directory where the Python scripts used by Toxik are located.
str
getTempDir(...)
Returns: The path (str) to the platform-specific directory where Toxik puts its temporary files.
str
getUserDocumentsDir(...)
Returns: The user directory where documents are stored by default.
str
substituteString(...)
Substitutes Toxik tokens (such as <ProjectHomeFolder>, <Date>, <CurrentUser>, etc) in the specified string and returns the resulting string.
Variables
  __package__ = 'autodesk_toxik'
Function Details

getAbsolutePath(path)

 
Parameters:
  • path (str)
Returns: str
The absolute path of a file for the given relative (or absolute) path. A relative path is assumed to be located under the root folder of the current project. If there's no project currently opened, the path is made absolute based on the current working directory.

statStr(libmgr, path)

 
Parameters:
Returns: str
A string representation of the output of stat for printout.

setUDA(componentPath, udaName, udaValue)

 

Convenience function that creates a UDA if it doesn't exist in the current project and sets its value on the specified component.

Parameters:
  • componentPath (str)
  • udaName (str)
  • udaValue (str)

getCurrentDir(...)

 
Returns: str
The current working directory of the process.

getHomeDir(...)

 
Returns: str
The home directory is a directory under which Toxik stores data on a per user basis, and under which the Toxik user data directory will be created.

getInstallDir(...)

 
Returns: str
The installation directory. i.e. the root of the Toxik installation hierarchy.

getLogFile(...)

 
Returns: str
The file name for the log file of the current process.

getOutputDir(...)

 
Returns: str
The directory under which Toxik stores log files and other run-time information. By default, the output directory is the same as the user data directory, but this value can be changed using the "toxik::deployment::outputDir" token in the "toxik.ini" Toxik initialization file, or using the DL_OUTPUT_DIR environment variable.

getPythonExec(...)

 
Returns: str
The python executable. The python executable is the path of the Python interpreter used by Toxik, which can be adjusted using either the "toxik::deployment::pythonExec" token in the "toxik.ini" Toxik initialization file, or using the DL_PYTHON_EXEC environment variable.

getResourcesDir(...)

 
Returns: str
The resources directory is where the Toxik runtime resource files reside. By default, this is under "<INSTALL_DIR>/resources", but can be adjusted using either the "toxik::deployment::resourcesDir" token in the Toxik initialization file, or using the DL_RESOURCES_DIR environment variable.

getRootDir(...)

 
Returns: str
The root directory (str) of the file system (/ on UNIX or the current drive on Windows).

getScriptsDir(...)

 
Returns: str
The path to the directory where the Python scripts used by Toxik are located.

getTempDir(...)

 
Returns: str
The path (str) to the platform-specific directory where Toxik puts its temporary files.

getUserDocumentsDir(...)

 
Returns: str
The user directory where documents are stored by default.

substituteString(...)

 

Substitutes Toxik tokens (such as <ProjectHomeFolder>, <Date>, <CurrentUser>, etc) in the specified string and returns the resulting string.

Parameters:
  • str (str) - String containing Toxik tokens.
Returns: str
The string with subsituted tokens.