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

Class UserMgr

 object --+    
          |    
Boost.Python.instance --+
              |
             UserMgr

For projects, users and machines (administrables) a common interface is implemented by their respective manager classes: ProjectMgr, UserMgr and MachineMgr.

Instance Methods
 
__init__(...)
The <Administrable>Mgr() constructor can be used to access the administrable manager singleton.
 
__reduce__(...)
helper for pickle

Inherited from Boost.Python.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
Administrable
create(...)
Creates a new administrable file at the specified location and returns its wrapping Administrable derived instance (does not set it as current).
 
createAndOpen(path, description='', overwrite=False)
Utility function to create a user and open it.
str
getActualFilePath(...)
Returns: The actual absolute file path of the given administrable name/path.
Administrable
getCurrent(...)
Returns: The Administrable derived instance set as the current one.
bool
isCurrent(...)
Returns: True if the given Administrable derived instance is the current one.
Administrable
load(...)
Loads the specified administrable file and returns the resulting Administrable derived instance.
Administrable
open(...)
Loads the specified administrable file, sets it as the current one and returns the resulting Administrable derived instance.
 
setCurrent(...)
Sets the current Administrable.
Class Variables
  __instance_size__ = 24
Properties

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 

The <Administrable>Mgr() constructor can be used to access the administrable manager singleton. This is optional however, since all administrable manager methods are static and therefore can be invoked on the class itself or on an instance of it. For example, the following two lines of code are equivalent:

   admin.ProjectMgr().create(...)
   admin.ProjectMgr.create(...)
Overrides: object.__init__

__reduce__(...)

 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

create(...)
Static Method

 

Creates a new administrable file at the specified location and returns its wrapping Administrable derived instance (does not set it as current).

Note: ProjectMgr.create() actually has more parameters; refer to the ProjectMgr specific interface.

Parameters:
  • path (str)
  • description (str) - An optional string parameter to set the administrable's description (defaults to "").
  • overwrite (bool) - An optional bool parameter indicating whether an existing administrable file can be overwritten (defaults to False).
Returns: Administrable
The created Administrable derived instance.
Raises:
  • Exception - If the administrable file cannot be created.

createAndOpen(path, description='', overwrite=False)
Static Method

 

Utility function to create a user and open it. Creates a new user file at the specified location, loads it, sets it as current and returns its wrapping Administrable derived instance.

See Also: create().

getActualFilePath(...)
Static Method

 
Parameters:
  • path (str)
Returns: str
The actual absolute file path of the given administrable name/path. It absolutizes the given path and adds its file extension if not already present.

getCurrent(...)
Static Method

 
Returns: Administrable
The Administrable derived instance set as the current one. i.e. the one used to query preferences by default, or None if there's no current.

isCurrent(...)
Static Method

 
Parameters:
Returns: bool
True if the given Administrable derived instance is the current one. i.e. the one used to query preferences by default.

load(...)
Static Method

 

Loads the specified administrable file and returns the resulting Administrable derived instance. For example:

   user = admin.UserMgr.load("/path/to/user.txuser")
Parameters:
  • path (str)
Returns: Administrable
The resulting Administrable derived instance.
Raises:
  • Exception - If the file doesn't exist or cannot be loaded.

open(...)
Static Method

 

Loads the specified administrable file, sets it as the current one and returns the resulting Administrable derived instance. For example:

   curProj = admin.ProjectMgr.open("/path/to/project.txproject")
Parameters:
  • path (str)
Returns: Administrable
The resulting Administrable derived instance.
Raises:
  • Exception - If the file doesn't exist or cannot be loaded.

setCurrent(...)
Static Method

 

Sets the current Administrable. i.e. the one used to query preferences by default.

Parameters: