Eidolon
|
Public Member Functions | |
def | __init__ (self, name, parentdir, mgr) |
def | addHandlers (self) |
def | create (self) |
def | remove (self) |
def | getLabel (self) |
def | getProjectDir (self) |
def | getProjectFile (self, filename) |
def | getScriptPath (self) |
def | getConfigPath (self) |
def | getVarName (self, obj) |
def | getProjectObj (self, name) |
def | hasFile (self, path) |
def | getUniqueObjName (self, name) |
def | addObject (self, obj) |
def | removeObject (self, obj) |
def | hasObject (self, obj) |
def | renameObject (self, obj, oldname) |
def | checkIncludeObject (self, obj) |
def | save (self) |
def | loadConfig (self, filename=None) |
def | saveConfig (self) |
def | getPropBox (self) |
def | updatePropBox (self, proj, prop) |
Public Attributes | |
name | |
parentdir | |
mgr | |
memberObjs | |
configMap | |
varcounter | |
checkboxMap | |
prop | |
header | |
backDir | |
Private Member Functions | |
def | _saveButton (self) |
def | _dirButton (self) |
def | _setApplyToObjCheck (self, item) |
This is the base class for all projects in the syste. A project is a directory with a script file specifying how to load the project, a config file containing project metadata or whatever else, a log directory containing previous versions of these amongst other logs, and all of the data files needed by the project. This object is meant to act as the bridge between the UI and a plugin containing project-specific functionality, so the a lot of the code in a project is about driving the UI in its properties box (which it can add to through getPropBox()) and some file IO. The project's lifecycle is summarized here: 1. Instantiated in SceneManager.createProjectObj() 2. Project.create() is called 3. Project.loadConfig() is called 4. User interacts with the project 5. Removed from the system by SceneManager.deleteProjectObj() 6. Project.remove() is called
def __init__ | ( | self, | |
name, | |||
parentdir, | |||
mgr | |||
) |
|
private |
|
private |
|
private |
def addHandlers | ( | self | ) |
Call this in the constructor to add event handlers to capture relevant events. With the handlers in place the checkIncludeObject(), renameObject(), and removeObject() methods will be called when the object add, rename, and remove events occur.
def addObject | ( | self, | |
obj | |||
) |
Add an object to the project if not already there, if `obj' is a SceneObjectRepr its parent is also added.
def checkIncludeObject | ( | self, | |
obj | |||
) |
Called whenever a SceneObject or SceneObjectRepr `obj' is added to the scene. This allows a project to include the object into itself and do all the file copying needed, usually after the user is prompted to do so or not.
def create | ( | self | ) |
Creates the project directory and other init tasks if necessary.
def getConfigPath | ( | self | ) |
Get the absolute path to the project's config file.
def getLabel | ( | self | ) |
def getProjectDir | ( | self | ) |
Get the project's directory.
def getProjectFile | ( | self, | |
filename | |||
) |
Get an absolute path to a file with name `filename' in the project's directory. This file need not exist.
def getProjectObj | ( | self, | |
name | |||
) |
Get the project object with the given name, or None if none has that name.
def getPropBox | ( | self | ) |
def getScriptPath | ( | self | ) |
Get the absolute path to the project's script file.
def getUniqueObjName | ( | self, | |
name | |||
) |
Returns an object name based on `name' whic is guaranteed to be unique, a valid filename, and will not cause a file to be overwritten in the current context when used to saved.
def getVarName | ( | self, | |
obj | |||
) |
Get the variable name associated with project member `obj' or None if `obj' is part of the project.
def hasFile | ( | self, | |
path | |||
) |
Returns True if `path' refers to a file/directory within the project's directory.
def hasObject | ( | self, | |
obj | |||
) |
def loadConfig | ( | self, | |
filename = None |
|||
) |
Load the config file (or `filename' if given) and update `self.configMap' with its contents.
def remove | ( | self | ) |
Removes handlers and does other cleanup functions.
def removeObject | ( | self, | |
obj | |||
) |
Remove an object from the project, if `obj' is a SceneObject its representations are first removed.
def renameObject | ( | self, | |
obj, | |||
oldname | |||
) |
Called when `obj' has been renamed from `oldname', giving the project the chance to rename files.
def save | ( | self | ) |
Save the project's script and config file.
def saveConfig | ( | self | ) |
Saves the config file from the values in `self.configMap'.
def updatePropBox | ( | self, | |
proj, | |||
prop | |||
) |
Update the property dialog for this project. The dialog box is `prop' while `proj' is always `self' just to maintain compatibility with the way the main window calls this method. This method should always be called by overrides to ensure the whole prop UI is filled out correctly.
backDir |
checkboxMap |
configMap |
header |
memberObjs |
mgr |
name |
parentdir |
prop |
varcounter |