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

Class ProjectMgr

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

The manager class for Project administrables has a slightly different interface than the manager class for User and Machine administrables.

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 project file at the specified location and returns its wrapping Project instance (does not set it as current).
Project
createAndOpen(path, homeFolder='', description='', overwrite=False)
Utility function to create a project 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.
 
validate(...)
Validates that the specified file is an actual Toxik project file.
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 project file at the specified location and returns its wrapping Project instance (does not set it as current).

Parameters:
  • path (str)
  • homeFolder (str) - An optional string parameter indicating the path of the project home folder. It may be empty as it is not essential to the project. When not defined, the project home folder is set after the OS/user home folder.
  • description (str) - An optional string parameter to set the project's description (default 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 project file cannot be created.

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

 

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

Parameters:
  • path (str) - Project file path.
  • homeFolder (str) - An optional string parameter indicating the path of the project home folder. If empty, the home folder will be
  • description (str)
  • overwrite (bool) - An optional bool parameter indicating whether an existing administrable file can be overwritten (defaults to False).
Returns: Project
The created Project instance.

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:

validate(...)
Static Method

 

Validates that the specified file is an actual Toxik project file.

Parameters:
  • path (str)
Raises:
  • Exception - If the specified project file is not valid. The raised exception indicates why the project file is not valid.