Eidolon
Public Member Functions | Public Attributes | Private Member Functions | List of all members
Project Class Reference
Inheritance diagram for Project:
Inheritance graph
Collaboration diagram for Project:
Collaboration graph

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)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  parentdir,
  mgr 
)

Member Function Documentation

◆ _dirButton()

def _dirButton (   self)
private
Here is the caller graph for this function:

◆ _saveButton()

def _saveButton (   self)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setApplyToObjCheck()

def _setApplyToObjCheck (   self,
  item 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addHandlers()

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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addObject()

def addObject (   self,
  obj 
)
Add an object to the project if not already there, if `obj' is a SceneObjectRepr its parent is also added.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIncludeObject()

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.
Here is the caller graph for this function:

◆ create()

def create (   self)
Creates the project directory and other init tasks if necessary.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConfigPath()

def getConfigPath (   self)
Get the absolute path to the project's config file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLabel()

def getLabel (   self)
Here is the caller graph for this function:

◆ getProjectDir()

def getProjectDir (   self)
Get the project's directory.
Here is the caller graph for this function:

◆ getProjectFile()

def getProjectFile (   self,
  filename 
)
Get an absolute path to a file with name `filename' in the project's directory. This file need not exist.
Here is the caller graph for this function:

◆ getProjectObj()

def getProjectObj (   self,
  name 
)
Get the project object with the given name, or None if none has that name.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPropBox()

def getPropBox (   self)
Here is the call graph for this function:

◆ getScriptPath()

def getScriptPath (   self)
Get the absolute path to the project's script file.
Here is the call graph for this function:

◆ getUniqueObjName()

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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVarName()

def getVarName (   self,
  obj 
)
Get the variable name associated with project member `obj' or None if `obj' is part of the project.

◆ hasFile()

def hasFile (   self,
  path 
)
Returns True if `path' refers to a file/directory within the project's directory.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasObject()

def hasObject (   self,
  obj 
)

◆ loadConfig()

def loadConfig (   self,
  filename = None 
)
Load the config file (or `filename' if given) and update `self.configMap' with its contents.
Here is the call graph for this function:

◆ remove()

def remove (   self)
Removes handlers and does other cleanup functions.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeObject()

def removeObject (   self,
  obj 
)
Remove an object from the project, if `obj' is a SceneObject its representations are first removed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ renameObject()

def renameObject (   self,
  obj,
  oldname 
)
Called when `obj' has been renamed from `oldname', giving the project the chance to rename files.
Here is the caller graph for this function:

◆ save()

def save (   self)
Save the project's script and config file.
Here is the caller graph for this function:

◆ saveConfig()

def saveConfig (   self)
Saves the config file from the values in `self.configMap'.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePropBox()

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.
Here is the call graph for this function:

Member Data Documentation

◆ backDir

backDir

◆ checkboxMap

checkboxMap

◆ configMap

configMap

◆ header

header

◆ memberObjs

memberObjs

◆ mgr

mgr

◆ name

name

◆ parentdir

parentdir

◆ prop

prop

◆ varcounter

varcounter

The documentation for this class was generated from the following file: