# eric3.Project.Project

Module implementing the project management functionality.

### Classes

Project | Module implementing the project management functionality.

### Functions

None

## Project

Module implementing the project management functionality.

#### Signals

directoryRemoved(string)
  emitted after a directory has been removed from the project
dirty(int)
  emitted when the dirty state changes
newProject()
  emitted after a new project was generated
projectClosed()
  emitted after a project was closed
projectFileRenamed(string, string)
  emitted after a file of the project has been renamed
projectFormAdded(string)
  emitted after a new form was added
projectInterfaceAdded(string)
  emitted after a new IDL file was added
projectLanguageAdded(string)
  emitted after a new language was added
projectOpened()
  emitted after a project file was read
projectOthersAdded(string)
  emitted after a file or directory was added to the OTHERS project data area
projectPropertiesChanged
  emitted after the project properties were changed
projectSessionLoaded()
  emitted after a project session file was loaded
projectSourceAdded(string)
  emitted after a new source file was added
pythonFile(string)
  emitted after a project file was read to open the main script

### Derived from

QObject

### Methods

Project | Constructor
addDirectory | Private method used to add all files of a directory to the project.
addFile | Public slot used to add a file to the project.
addIdlDir | Public slot to add all IDL interfaces of a directory to the current project.
addIdlFile | Public slot to add an IDL interface to the current project.
addLanguage | Public slot used to add a language to the project.
addOthersDir | Private slot to add a directory to the OTHERS project data.
addOthersFile | Private slot to add a file to the OTHERS project data.
addPyDir | Public slot to add all python files of a directory to the current project.
addPyFile | Public slot to add a python file to the current project.
addRecursiveDirectory | Private method used to add all files of a directory tree.
addSingleDirectory | Private method used to add all files of a single directory to the project.
addToOthers | Private method to add file/directory to the OTHERS project data.
addUiDir | Public slot to add all forms of a directory to the current project.
addUiFile | Public slot to add a form to the current project.
appendFile | Public method to append a file to the project.
checkDirty | Private method to check dirty status and open a message window.
checkFilesExist | Private method to check, if the files in a list exist.
closeProject | Public slot to close the current project.
copyDirectory | Public slot to copy a directory.
deleteDirectory | Public slot to delete a directory from the project directory.
deleteFile | Public slot to delete a file from the project directory.
deleteLanguage | Public slot to delete a translation from the project directory.
deleteSession | Public method to delete the session file.
getActions | Public method to get a list of all actions.
getFiles | Public method to get all files starting with a common prefix.
getMainScript | Public method to return the main script filename.
getSources | Public method to return the source script files.
handleApplicationDiagram | Private method to handle the application diagram context menu action.
handleClearRecent | Private method to clear the recent projects menu.
handleCodeCoverage | Private slot used to show the code coverage information for the project files.
handleCodeMetrics | Private slot used to calculate some code metrics for the project files.
handleCyclopsReport | Private slot used to show the Cyclops report for the project.
handleOpenRecent | Private method to open a project from the list of rencently opened projects.
handleProfileData | Private slot used to show the profiling information for the project.
handleRemoveCyclopsReport | Private slot used to remove the Cyclops report for the project.
handleSearchNewFiles | Private slot used to handle the search new files action.
handleShowRecentMenu | Private method to set up the recent projects menu.
handleShowShowMenu | Private slot called before the show menu is shown.
handleShowVCSMenu | Private slot called before the vcs menu is shown.
handleSyntaxCheck | Private slot used to check the project files for bad indentations.
handleTabnanny | Private slot used to check the project files for bad indentations.
init | Private method to initialize the project data part.
initActions | Public slot to initialize the project related actions.
initMenu | Public slot to initialize the project menu.
initToolbar | Public slot to initialize the project toolbar.
initVCS | Private method used to instantiate a vcs system.
initVCSActions | Private method to initialize the VCS actions.
isDirty | Public method to return the dirty state.
isOpen | Public method to return the opened state.
isProjectSource | Public method used to check, if the passed in filename belongs to the project.
moveDirectory | Public slot to move a directory.
newProject | Public slot to built a new project.
openProject | Public slot to open a project.
othersAdded | Public slot to be called, if something was added to the OTHERS project data area.
readProject | Public method to read in a project (.e3p, .e3pz) file.
readSession | Private method to read in the project session file (.e3s)
readTasks | Private method to read in the project tasks file (.e3t)
readXMLProject | Public method to read the project data from an XML file.
readXMLSession | Public method to read the session data from an XML file.
readXMLTasks | Public method to read the project tasks data from an XML file.
removeDirectory | Public slot to remove a directory from the project.
removeFile | Public slot to remove a file from the project.
removeLanguage | Public slot to remove a translation from the project.
renameFile | Public slot to rename a file of the project.
renameMainScript | Public method to rename the main script.
saveAllScripts | Public method to save all scripts belonging to the project.
saveProject | Public slot to save the current project.
saveProjectAs | Public slot to save the current project to a different file.
searchNewFiles | Private method to search for new files in the project directory.
setDbgInfo | Public method to set the debugging information.
setDirty | Private method to set the dirty state.
showProperties | Public slot to display the properties dialog.
svnBranchList | Private slot used to list the branches of the project.
svnExtendedDiff | Private slot used to perform a svn diff with the selection of revisions.
svnPropDel | Private slot used to delete a property for the project files.
svnPropList | Private slot used to list the properties of the project files.
svnPropSet | Private slot used to set a property for the project files.
svnResolve | Private slot used to resolve conflicts of the local project.
svnTagList | Private slot used to list the tags of the project.
vcsCheckout | Private slot used to create a local project from the repository.
vcsCleanup | Private slot used to cleanup the local project.
vcsCommand | Private slot used to execute an arbitrary vcs command.
vcsCommandOptions | Private slot to edit the VCS command options.
vcsCommit | Private slot used to commit changes to the local project to the repository.
vcsDiff | Private slot used to show the difference of the local project to the repository.
vcsExport | Private slot used to export a project from the repository.
vcsImport | Private slot used to import the local project into the repository.
vcsLog | Private slot used to show the log of the local project.
vcsLogin | Private slot used to login to a remote repository.
vcsLogout | Private slot used to logout from a remote repository.
vcsMerge | Private slot used to merge changes of a tag/revision into the local project.
vcsRemove | Private slot used to remove the local project from the repository.
vcsRevert | Private slot used to revert changes made to the local project.
vcsStatus | Private slot used to show the status of the local project.
vcsSwitch | Private slot used to switch the local project to another tag/branch.
vcsTag | Private slot used to tag the local project in the repository.
vcsUpdate | Private slot used to update the local project from the repository.
writeProject | Public method to save the project infos to a project file.
writeSession | Public method to write the session data to an XML file (.e3s).
writeTasks | Public method to write the tasks data to an XML file (.e3t).
writeXMLProject | Public method to write the project data to an XML file.

### Project (Constructor)

Project(parent = None, filename = None)

Constructor

filename
  optional filename of a project file to open (string)
parent
  parent widget (usually the ui object) (QWidget)

### Project.addDirectory

addDirectory(filter=None)

Private method used to add all files of a directory to the project.

filter
  filter to be applied (string)

### Project.addFile

addFile(filter = None)

Public slot used to add a file to the project.

filter
  filter to be used by the add file dialog (string)

### Project.addIdlDir

addIdlDir()

Public slot to add all IDL interfaces of a directory to the current project.

### Project.addIdlFile

addIdlFile()

Public slot to add an IDL interface to the current project.

### Project.addLanguage

addLanguage()

Public slot used to add a language to the project.

### Project.addOthersDir

addOthersDir()

Private slot to add a directory to the OTHERS project data.

### Project.addOthersFile

addOthersFile()

Private slot to add a file to the OTHERS project data.

### Project.addPyDir

addPyDir()

Public slot to add all python files of a directory to the current project.

### Project.addPyFile

addPyFile()

Public slot to add a python file to the current project.

### Project.addRecursiveDirectory

addRecursiveDirectory(filter, source, target)

Private method used to add all files of a directory tree. The tree is rooted at source to another one rooted at target. This method decents down to the lowest subdirectory.

filter
  filter to be applied (string)
source
  source directory (string)
target
  target directory (string)

### Project.addSingleDirectory

addSingleDirectory(filter, source, target, quiet=0)

Private method used to add all files of a single directory to the project.

filter
  filter to be applied (string)
quiet
  flag indicating quiet operations (boolean)
source
  source directory (string)
target
  target directory (string)

### Project.addToOthers

addToOthers(fn)

Private method to add file/directory to the OTHERS project data.

fn
  filename or directoryname to add

### Project.addUiDir

addUiDir()

Public slot to add all forms of a directory to the current project.

### Project.addUiFile

addUiFile()

Public slot to add a form to the current project.

### Project.appendFile

appendFile(fn, isPythonFile=0)

Public method to append a file to the project.

fn
  filename to be added to the project (string or QString)
isPythonFile
  flag indicating that this is a source file even if it doesn't have the source extension (boolean)

### Project.checkDirty

checkDirty()

Private method to check dirty status and open a message window.

Returns:
  flag indicating whether this operation was successful

### Project.checkFilesExist

checkFilesExist(index)

Private method to check, if the files in a list exist. The files in the indicated list are checked for existance in the filesystem. Non existant files are removed from the list and the dirty state of the project is changed accordingly.

index
  key of the list to be checked (string)

### Project.closeProject

closeProject()

Public slot to close the current project.

Returns:
  flag indicating success (boolean)

### Project.copyDirectory

copyDirectory(olddn, newdn)

Public slot to copy a directory.

newdn
  new directory name (string or QString)
olddn
  original directory name (string or QString)

### Project.deleteDirectory

deleteDirectory(dn)

Public slot to delete a directory from the project directory.

dn
  directory name to be removed from the project

Returns:
  flag indicating success

### Project.deleteFile

deleteFile(fn)

Public slot to delete a file from the project directory.

fn
  filename to be deleted from the project

Returns:
  flag indicating success

### Project.deleteLanguage

deleteLanguage(lang)

Public slot to delete a translation from the project directory.

lang
  the language to be removed (string)

Returns:
  filename of the translation file. The return value is an empty string in case of an error (string)

### Project.deleteSession

deleteSession()

Public method to delete the session file.

### Project.getActions

getActions()

Public method to get a list of all actions.

Returns:
  list of all actions (list of E3Action)

### Project.getFiles

getFiles(start)

Public method to get all files starting with a common prefix.

start
  prefix (string or QString)

### Project.getMainScript

getMainScript(normalized = 0)

Public method to return the main script filename.

normalized
  flag indicating a normalized filename is wanted

Returns:
  filename of the projects main script (string)

### Project.getSources

getSources(normalized = 0)

Public method to return the source script files.

normalized
  flag indicating a normalized filename is wanted

Returns:
  list of the projects scripts (list of string)

### Project.handleApplicationDiagram

handleApplicationDiagram()

Private method to handle the application diagram context menu action.

### Project.handleClearRecent

handleClearRecent()

Private method to clear the recent projects menu.

### Project.handleCodeCoverage

handleCodeCoverage()

Private slot used to show the code coverage information for the project files.

### Project.handleCodeMetrics

handleCodeMetrics()

Private slot used to calculate some code metrics for the project files.

### Project.handleCyclopsReport

handleCyclopsReport()

Private slot used to show the Cyclops report for the project.

### Project.handleOpenRecent

handleOpenRecent(idx)

Private method to open a project from the list of rencently opened projects.

### Project.handleProfileData

handleProfileData()

Private slot used to show the profiling information for the project.

### Project.handleRemoveCyclopsReport

handleRemoveCyclopsReport()

Private slot used to remove the Cyclops report for the project.

### Project.handleSearchNewFiles

handleSearchNewFiles()

Private slot used to handle the search new files action.

### Project.handleShowRecentMenu

handleShowRecentMenu()

Private method to set up the recent projects menu.

### Project.handleShowShowMenu

handleShowShowMenu()

Private slot called before the show menu is shown.

### Project.handleShowVCSMenu

handleShowVCSMenu()

Private slot called before the vcs menu is shown.

### Project.handleSyntaxCheck

handleSyntaxCheck()

Private slot used to check the project files for bad indentations.

### Project.handleTabnanny

handleTabnanny()

Private slot used to check the project files for bad indentations.

### Project.init

init()

Private method to initialize the project data part.

### Project.initActions

initActions()

Public slot to initialize the project related actions.

### Project.initMenu

initMenu()

Public slot to initialize the project menu.

Returns:
  the menu generated (QPopupMenu)

### Project.initToolbar

initToolbar()

Public slot to initialize the project toolbar.

Returns:
  the toolbar generated (QToolBar)

### Project.initVCS

initVCS(vcsSystem=None)

Private method used to instantiate a vcs system.

vcsSystem
  type of VCS to be used

Returns:
  a reference to the vcs object

### Project.initVCSActions

initVCSActions()

Private method to initialize the VCS actions.

### Project.isDirty

isDirty()

Public method to return the dirty state.

Returns:
  dirty state (boolean)

### Project.isOpen

isOpen()

Public method to return the opened state.

Returns:
  open state (boolean)

### Project.isProjectSource

isProjectSource(fn)

Public method used to check, if the passed in filename belongs to the project.

fn
  filename to be checked (string or QString)

Returns:
  flag indicating membership (boolean)

### Project.moveDirectory

moveDirectory(olddn, newdn)

Public slot to move a directory.

newdn
  new directory name (string or QString)
olddn
  old directory name (string or QString)

### Project.newProject

newProject()

Public slot to built a new project. This method displays the new project dialog and initializes the project object with the data entered.

### Project.openProject

openProject(fn = None)

Public slot to open a project.

fn
  optional filename of the project file to be read

### Project.othersAdded

othersAdded(fn)

Public slot to be called, if something was added to the OTHERS project data area.

fn
  filename or directory name added (string or QString)

### Project.readProject

readProject(fn)

Public method to read in a project (.e3p, .e3pz) file.

fn
  filename of the project file to be read (string or QString)

Returns:
  flag indicating success

### Project.readSession

readSession(quiet=0)

Private method to read in the project session file (.e3s)

quiet
  flag indicating quiet operations. If this flag is true, no errors are reported.

### Project.readTasks

readTasks()

Private method to read in the project tasks file (.e3t)

### Project.readXMLProject

readXMLProject(fn, validating)

Public method to read the project data from an XML file.

fn
  filename of the project file to be read (string or QString)
validating
  flag indicating a validation of the XML file is requested (boolean)

Returns:
  flag indicating success

### Project.readXMLSession

readXMLSession(fn, validating, quiet)

Public method to read the session data from an XML file. The data read is:

- all open source filenames
- the active window
- all breakpoints
- the commandline
- the working directory
- the exception reporting flag
- the list of exception types to be highlighted
- all bookmarks

fn
  filename of the project session file to be read (string or QString)
quiet
  flag indicating quiet operations. If this flag is true, no errors are reported.
validating
  flag indicating a validation of the XML file is requested (boolean)

### Project.readXMLTasks

readXMLTasks(fn, validating)

Public method to read the project tasks data from an XML file.

fn
  filename of the project tasks file to be read (string or QString)
validating
  flag indicating a validation of the XML file is requested (boolean)

### Project.removeDirectory

removeDirectory(dn)

Public slot to remove a directory from the project. The directory is not deleted from the project directory.

dn
  directory name to be removed from the project

### Project.removeFile

removeFile(fn)

Public slot to remove a file from the project. The file is not deleted from the project directory.

fn
  filename to be removed from the project

### Project.removeLanguage

removeLanguage(lang)

Public slot to remove a translation from the project. The translation file is not deleted from the project directory.

lang
  the language to be removed (string)

Returns:
  filename of the translation file (string)

### Project.renameFile

renameFile(oldfn, newfn=None)

Public slot to rename a file of the project.

newfn
  new filename of the file (string)
oldfn
  old filename of the file (string)

Returns:
  flag indicating success

### Project.renameMainScript

renameMainScript(oldfn, newfn)

Public method to rename the main script.

newfn
  new filename of the main script (string)
oldfn
  old filename (string)

### Project.saveAllScripts

saveAllScripts()

Public method to save all scripts belonging to the project.

Returns:
  flag indicating success

### Project.saveProject

saveProject()

Public slot to save the current project.

Returns:
  flag indicating success

### Project.saveProjectAs

saveProjectAs()

Public slot to save the current project to a different file.

Returns:
  flag indicating success

### Project.searchNewFiles

searchNewFiles(AI=1, onUserDemand=0)

Private method to search for new files in the project directory. If new files were found it shows a dialog listing these files and gives the user the oportunity to select the ones he wants to include. If 'Automatic Inclusion' is enabled, the new files are automatically added to the project.

AI
  flag indicating whether the automatic inclusion should be honoured
onUserDemand
  flag indicating whether this method was requested by the user via a menu action

### Project.setDbgInfo

setDbgInfo(argv, wd, env, excReporting, excList, tracePython=None, covexcPattern=None)

Public method to set the debugging information.

argv
  command line arguments to be used (string or QString)
covexcPattern=
  regexp pattern to exclude lines from code coverage (string or QString)
env
  environment setting (string or QString)
excList
  list of exceptions to be highlighted (list of string)
excReporting
  flag indicating the highlighting of exceptions
tracePython=
  flag to indicate if the Python library should be traced as well (boolean)
wd
  working directory (string or QString)

### Project.setDirty

setDirty(b)

Private method to set the dirty state. It emits the signal dirty(int).

b
  dirty state (boolean)

### Project.showProperties

showProperties()

Public slot to display the properties dialog.

### Project.svnBranchList

svnBranchList()

Private slot used to list the branches of the project.

### Project.svnExtendedDiff

svnExtendedDiff()

Private slot used to perform a svn diff with the selection of revisions.

### Project.svnPropDel

svnPropDel()

Private slot used to delete a property for the project files.

### Project.svnPropList

svnPropList()

Private slot used to list the properties of the project files.

### Project.svnPropSet

svnPropSet()

Private slot used to set a property for the project files.

### Project.svnResolve

svnResolve()

Private slot used to resolve conflicts of the local project.

### Project.svnTagList

svnTagList()

Private slot used to list the tags of the project.

### Project.vcsCheckout

vcsCheckout(export=0)

Private slot used to create a local project from the repository.

export
  flag indicating whether an export or a checkout should be performed

### Project.vcsCleanup

vcsCleanup()

Private slot used to cleanup the local project.

### Project.vcsCommand

vcsCommand()

Private slot used to execute an arbitrary vcs command.

### Project.vcsCommandOptions

vcsCommandOptions()

Private slot to edit the VCS command options.

### Project.vcsCommit

vcsCommit()

Private slot used to commit changes to the local project to the repository.

### Project.vcsDiff

vcsDiff()

Private slot used to show the difference of the local project to the repository.

### Project.vcsExport

vcsExport()

Private slot used to export a project from the repository.

### Project.vcsImport

vcsImport()

Private slot used to import the local project into the repository. NOTE: This does not make the local project a vcs controlled project. You have to checkout the project from the repository in order to accomplish that.

### Project.vcsLog

vcsLog()

Private slot used to show the log of the local project.

### Project.vcsLogin

vcsLogin()

Private slot used to login to a remote repository.

### Project.vcsLogout

vcsLogout()

Private slot used to logout from a remote repository.

### Project.vcsMerge

vcsMerge()

Private slot used to merge changes of a tag/revision into the local project.

### Project.vcsRemove

vcsRemove()

Private slot used to remove the local project from the repository. Depending on the parameters set in the vcs object the project may be removed from the local disk as well.

### Project.vcsRevert

vcsRevert()

Private slot used to revert changes made to the local project.

### Project.vcsStatus

vcsStatus()

Private slot used to show the status of the local project.

### Project.vcsSwitch

vcsSwitch()

Private slot used to switch the local project to another tag/branch.

### Project.vcsTag

vcsTag()

Private slot used to tag the local project in the repository.

### Project.vcsUpdate

vcsUpdate()

Private slot used to update the local project from the repository.

### Project.writeProject

writeProject(fn = None)

Public method to save the project infos to a project file.

fn
  optional filename of the project file to be written. If fn is None, the filename stored in the project object is used. This is the 'save' action. If fn is given, this filename is used instead of the one in the project object. This is the 'save as' action.

Returns:
  flag indicating success

### Project.writeSession

writeSession(quiet=0)

Public method to write the session data to an XML file (.e3s). The data saved is:

- all open source filenames belonging to the project
- the active window, if it belongs to the project
- all breakpoints
- the commandline
- the working directory
- the exception reporting flag
- the list of exception types to be highlighted
- all bookmarks of files belonging to the project

quiet
  flag indicating quiet operations. If this flag is true, no errors are reported.

### Project.writeTasks

writeTasks()

Public method to write the tasks data to an XML file (.e3t).

### Project.writeXMLProject

writeXMLProject(fn = None)

Public method to write the project data to an XML file.

fn
  the filename of the project file (string)

Up