# 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.
addFiles | Public slot used to add files to the project.
addIdlDir | Public slot to add all IDL interfaces of a directory to the current project.
addIdlFiles | Public slot to add IDL interfaces 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.
addOthersFiles | Private slot to add files to the OTHERS project data.
addPyDir | Public slot to add all python files of a directory to the current project.
addPyFiles | Public slot to add python files 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.
addUiFiles | Public slot to add forms 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.
checkSecurityString | Public method to check a string for security problems.
closeProject | Public slot to close the current project.
copyDirectory | Public slot to copy a directory.
deleteDebugProperties | Private method to delete the project debugger properties file (.e3d)
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.
getDebugProperty | Public method to retrieve a debugger property.
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.
getUiType | Public method to get the UI type of the project.
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.
handlePyLint | Private slot used to check the project with pylint.
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 syntax.
handleTabnanny | Private slot used to check the project files for bad indentations.
hasEntry | Public method to check the project for a file.
init | Private method to initialize the project data part.
initActions | Public slot to initialize the project related actions.
initDebugProperties | Private method to initialize the debug properties.
initFileTypes | Private method to initialize the filetype associations with default values.
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.
isDebugPropertiesLoaded | Public method to return the status of the debug properties.
isDirty | Public method to return the dirty state.
isOpen | Public method to return the opened state.
isProjectForm | Public method used to check, if the passed in filename belongs to the project forms.
isProjectInterface | Public method used to check, if the passed in filename belongs to the project interfaces.
isProjectSource | Public method used to check, if the passed in filename belongs to the project sources.
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.
readDebugProperties | Private method to read in the project debugger properties file (.e3d)
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)
readXMLDebugProperties | Public method to read the debugger properties from an XML file.
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.
showDebugProperties | Private slot to display the debugger properties dialog.
showFiletypeAssociations | Public slot to display the filetype association dialog.
showProperties | Public slot to display the properties dialog.
writeDebugProperties | Private method to write the project debugger properties file (.e3d)
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

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

### Project.addDirectory

addDirectory(filter=None, startdir = None)

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

filter
  filter to be applied (string)
startdir
  start directory for the selection dialog

### Project.addFiles

addFiles(filter = None, startdir = None)

Public slot used to add files to the project.

filter
  filter to be used by the add file dialog (string)
startdir
  start directory for the selection dialog

### Project.addIdlDir

addIdlDir()

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

### Project.addIdlFiles

addIdlFiles()

Public slot to add IDL interfaces 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.addOthersFiles

addOthersFiles()

Private slot to add files to the OTHERS project data.

### Project.addPyDir

addPyDir()

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

### Project.addPyFiles

addPyFiles()

Public slot to add python files 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)
source
  source directory (string)
target
  target directory (string)
quiet
  flag indicating quiet operations (boolean)

### 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.addUiFiles

addUiFiles()

Public slot to add forms 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.checkSecurityString

checkSecurityString(stringToCheck, tag)

Public method to check a string for security problems.

stringToCheck
  string that should be checked for security problems (string)
tag
  tag that contained the string (string)

Returns:
  flag indicating a security problem (boolean)

### 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.

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

### Project.deleteDebugProperties

deleteDebugProperties()

Private method to delete the project debugger properties file (.e3d)

### 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.getDebugProperty

getDebugProperty(key)

Public method to retrieve a debugger property.

key
  key of the property (string)

Returns:
  value of the property

### 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.getUiType

getUiType()

Public method to get the UI type of the project.

Returns:
  UI type of the project (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.handlePyLint

handlePyLint()

Private slot used to check the project with pylint.

### 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 syntax.

### Project.handleTabnanny

handleTabnanny()

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

### Project.hasEntry

hasEntry(fn)

Public method to check the project for a file.

fn
  filename to be checked (string or QString)

Returns:
  flag indicating, if the project contains the file (boolean)

### Project.init

init()

Private method to initialize the project data part.

### Project.initActions

initActions()

Public slot to initialize the project related actions.

### Project.initDebugProperties

initDebugProperties()

Private method to initialize the debug properties.

### Project.initFileTypes

initFileTypes()

Private method to initialize the filetype associations with default values.

### 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.isDebugPropertiesLoaded

isDebugPropertiesLoaded()

Public method to return the status of the debug properties.

Returns:
  load status of debug properties (boolean)

### 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.isProjectForm

isProjectForm(fn)

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

fn
  filename to be checked (string or QString)

Returns:
  flag indicating membership (boolean)

### Project.isProjectInterface

isProjectInterface(fn)

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

fn
  filename to be checked (string or QString)

Returns:
  flag indicating membership (boolean)

### Project.isProjectSource

isProjectSource(fn)

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

fn
  filename to be checked (string or QString)

Returns:
  flag indicating membership (boolean)

### Project.moveDirectory

moveDirectory(olddn, newdn)

Public slot to move a directory.

olddn
  old directory name (string or QString)
newdn
  new 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.readDebugProperties

readDebugProperties(quiet=0)

Private method to read in the project debugger properties file (.e3d)

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

### 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.readXMLDebugProperties

readXMLDebugProperties(fn, validating, quiet)

Public method to read the debugger properties from an XML file.

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

### 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)
validating
  flag indicating a validation of the XML file is requested (boolean)
quiet
  flag indicating quiet operations. If this flag is true, no errors are reported.

### 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.

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

Returns:
  flag indicating success

### Project.renameMainScript

renameMainScript(oldfn, newfn)

Public method to rename the main script.

oldfn
  old filename (string)
newfn
  new filename of the main script (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)
wd
  working directory (string or QString)
env
  environment setting (string or QString)
excReporting
  flag indicating the highlighting of exceptions
excList
  list of exceptions to be highlighted (list of string)
tracePython=
  flag to indicate if the Python library should be traced as well (boolean)
covexcPattern=
  regexp pattern to exclude lines from code coverage (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.showDebugProperties

showDebugProperties()

Private slot to display the debugger properties dialog.

### Project.showFiletypeAssociations

showFiletypeAssociations()

Public slot to display the filetype association dialog.

### Project.showProperties

showProperties()

Public slot to display the properties dialog.

### Project.writeDebugProperties

writeDebugProperties(quiet=0)

Private method to write the project debugger properties file (.e3d)

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

### 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