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

completeRepopulateItem(string)
emitted after an item of the model was repopulated
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
prepareRepopulateItem(string)
emitted before an item of the model is repopulated
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
projectResourceAdded(string)
emitted after a new resource file was added
projectSessionLoaded()
emitted after a project session file was loaded
projectSourceAdded(string)
emitted after a new source file was added
reinitVCS()
emitted after the VCS has been reinitialized
sourceFile(string)
emitted after a project file was read to open the main script
vcsStatusMonitorStatus(QString, QString)
emitted to signal the status of the monitoring thread (ok, nok, op, off) and a status message

Derived from

QObject

Methods

Project Constructor
__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.
__checkFilesExist Private method to check, if the files in a list exist.
__clearRecent Private method to clear the recent projects menu.
__closeAllWindows Private method to close all project related windows.
__deleteDebugProperties Private method to delete the project debugger properties file (.e3d)
__deleteSession Private method to delete the session file.
__doSearchNewFiles Private method to search for new files in the project directory.
__initData Private method to initialize the project data part.
__initDebugProperties Private method to initialize the debug properties.
__initFileTypes Private method to initialize the filetype associations with default values.
__initUiTypes Private method to initialize the list of supported UI types.
__loadRecent Private method to load the recently opened project filenames.
__openRecent Private method to open a project from the list of rencently opened projects.
__readDebugProperties Private method to read in the project debugger properties file (.e4d, .e3d)
__readProject Private method to read in a project (.e4p, .e4pz, .e3p, .e3pz) file.
__readSession Private method to read in the project session file (.e4s, .e3s)
__readTasks Private method to read in the project tasks file (.e4t, .e3t)
__readUserProperties Private method to read in the user specific project file (.e4q)
__readXMLDebugProperties Public method to read the debugger properties from an XML file.
__readXMLProject Private method to read the project data from an XML file.
__readXMLSession Private method to read the session data from an XML file.
__readXMLTasks Private method to read the project tasks data from an XML file.
__removeCyclopsReport Private slot used to remove the Cyclops report for the project.
__saveRecent Private method to save the list of recently opened filenames.
__searchNewFiles Private slot used to handle the search new files action.
__showCodeCoverage Private slot used to show the code coverage information for the project files.
__showCodeMetrics Private slot used to calculate some code metrics for the project files.
__showCyclopsReport Private slot used to show the Cyclops report for the project.
__showDebugProperties Private slot to display the debugger properties dialog.
__showFiletypeAssociations Public slot to display the filetype association dialog.
__showMenu Private method to set up the project menu.
__showProfileData Private slot used to show the profiling information for the project.
__showProperties Private slot to display the properties dialog.
__showRecentMenu Private method to set up the recent projects menu.
__showShowMenu Private slot called before the show menu is shown.
__showUserProperties Private slot to display the user specific properties dialog.
__showVCSMenu Private slot called before the vcs menu is shown.
__statusMonitorStatus Private method to receive the status monitor status.
__syncRecent Private method to synchronize the list of recently opened projects with the central store.
__writeDebugProperties Private method to write the project debugger properties file (.e4d)
__writeProject Private method to save the project infos to a project file.
__writeSession Private method to write the session data to an XML file (.e4s).
__writeTasks Private method to write the tasks data to an XML file (.e4t).
__writeUserProperties Private method to write the project data to an XML file.
__writeXMLProject Private method to write the project data to an XML file.
addDirectory Public 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.
addLanguageFile Public slot to add a translation file.
addOthersDir Private slot to add a directory to the OTHERS project data.
addOthersFiles Private slot to add files to the OTHERS project data.
addResourceDir Public slot to add all Qt resource files of a directory to the current project.
addResourceFiles Public slot to add Qt resources to the current project.
addSourceDir Public slot to add all source files of a directory to the current project.
addSourceFiles Public slot to add source files to the current project.
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 Public method to check dirty status and open a message window.
checkLanguageFiles Public slot to check the language files after a release process.
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.
deleteDirectory Public slot to delete a directory from the project directory.
deleteFile Public slot to delete a file from the project directory.
deleteLanguageFile Public slot to delete a translation from the project directory.
getActions Public method to get a list of all actions.
getDebugProperty Public method to retrieve a debugger property.
getDefaultSourceExtension Public method to get the default extension for the project's programming language.
getFiles Public method to get all files starting with a common prefix.
getMainScript Public method to return the main script filename.
getModel Public method to get a reference to the project browser model.
getProjectLanguage Public method to get the project's programming language.
getProjectPath Public method to get the project path.
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.
handlePreferencesChanged Public slot used to handle the preferencesChanged signal.
handlePyLint Public slot used to check the project with pylint.
handleSyntaxCheck Public slot used to check the project files for bad syntax.
handleTabnanny Public slot used to check the project files for bad indentations.
hasEntry Public method to check the project for a file.
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 Public 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.
isProjectResource Public method used to check, if the passed in filename belongs to the project resources.
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.
registerUiType Public method to register a UI type.
removeDirectory Public slot to remove a directory from the project.
removeFile Public slot to remove a file from the project.
removeLanguageFile Public slot to remove a translation from the project.
renameFile Public slot to rename a file of the project.
renameFileInPdata Public method to rename a file in the pdata structure.
renameMainScript Public method to rename the main script.
repopulateItem Public slot to repopulate a named item.
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.
setDbgInfo Public method to set the debugging information.
setDirty Public method to set the dirty state.
unregisterUiType Public method to unregister a UI type.

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

__addRecursiveDirectory(ext, 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.

ext
extension of files to add (string)
source
source directory (string)
target
target directory (string)

Project.__addSingleDirectory

__addSingleDirectory(ext, source, target, quiet=0)

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

ext
extension of files to add (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.__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.__clearRecent

__clearRecent()

Private method to clear the recent projects menu.

Project.__closeAllWindows

__closeAllWindows()

Private method to close all project related windows.

Project.__deleteDebugProperties

__deleteDebugProperties()

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

Project.__deleteSession

__deleteSession()

Private method to delete the session file.

Project.__doSearchNewFiles

__doSearchNewFiles(AI = True, onUserDemand = False)

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

__initData()

Private method to initialize the project data part.

Project.__initDebugProperties

__initDebugProperties()

Private method to initialize the debug properties.

Project.__initFileTypes

__initFileTypes()

Private method to initialize the filetype associations with default values.

Project.__initUiTypes

__initUiTypes()

Private method to initialize the list of supported UI types.

Project.__loadRecent

__loadRecent()

Private method to load the recently opened project filenames.

Project.__openRecent

__openRecent(act)

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

act
reference to the action that triggered (QAction)

Project.__readDebugProperties

__readDebugProperties(quiet=0)

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

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

Project.__readProject

__readProject(fn)

Private method to read in a project (.e4p, .e4pz, .e3p, .e3pz) file.

fn
filename of the project file to be read (string or QString)
Returns:
flag indicating success

Project.__readSession

__readSession(quiet = False)

Private method to read in the project session file (.e4s, .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 (.e4t, .e3t)

Project.__readUserProperties

__readUserProperties()

Private method to read in the user specific project file (.e4q)

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)

Private 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)

Private method to read the session data from an XML file.

The data read is:

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)

Private 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.__removeCyclopsReport

__removeCyclopsReport()

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

Project.__saveRecent

__saveRecent()

Private method to save the list of recently opened filenames.

Project.__searchNewFiles

__searchNewFiles()

Private slot used to handle the search new files action.

Project.__showCodeCoverage

__showCodeCoverage()

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

Project.__showCodeMetrics

__showCodeMetrics()

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

Project.__showCyclopsReport

__showCyclopsReport()

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

Project.__showDebugProperties

__showDebugProperties()

Private slot to display the debugger properties dialog.

Project.__showFiletypeAssociations

__showFiletypeAssociations()

Public slot to display the filetype association dialog.

Project.__showMenu

__showMenu()

Private method to set up the project menu.

Project.__showProfileData

__showProfileData()

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

Project.__showProperties

__showProperties()

Private slot to display the properties dialog.

Project.__showRecentMenu

__showRecentMenu()

Private method to set up the recent projects menu.

Project.__showShowMenu

__showShowMenu()

Private slot called before the show menu is shown.

Project.__showUserProperties

__showUserProperties()

Private slot to display the user specific properties dialog.

Project.__showVCSMenu

__showVCSMenu()

Private slot called before the vcs menu is shown.

Project.__statusMonitorStatus

__statusMonitorStatus(status, statusMsg)

Private method to receive the status monitor status.

It simply reemits the received status.

status
status of the monitoring thread (QString, ok, nok or off)
statusMsg
explanotory text for the signaled status (QString)

Project.__syncRecent

__syncRecent()

Private method to synchronize the list of recently opened projects with the central store.

Project.__writeDebugProperties

__writeDebugProperties(quiet=0)

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

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

Project.__writeProject

__writeProject(fn = None)

Private 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 = False)

Private method to write the session data to an XML file (.e4s).

The data saved is:

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

Project.__writeTasks

__writeTasks()

Private method to write the tasks data to an XML file (.e4t).

Project.__writeUserProperties

__writeUserProperties()

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

Project.__writeXMLProject

__writeXMLProject(fn = None)

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

fn
the filename of the project file (string)

Project.addDirectory

addDirectory(filter = None, startdir = None)

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

filter
filter to be used by the add directory dialog (string out of source, form, interface, others)
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 out of source, form, interface, others)
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.addLanguageFile

addLanguageFile(langFile)

Public slot to add a translation file.

langFile
the translation file to be removed (string)

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

addResourceDir()

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

Project.addResourceFiles

addResourceFiles()

Public slot to add Qt resources to the current project.

Project.addSourceDir

addSourceDir()

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

Project.addSourceFiles

addSourceFiles()

Public slot to add source files to the current project.

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, isSourceFile = False, updateModel = True)

Public method to append a file to the project.

fn
filename to be added to the project (string or QString)
isSourceFile
flag indicating that this is a source file even if it doesn't have the source extension (boolean)
updateModel
flag indicating an update of the model is requested (boolean)

Project.checkDirty

checkDirty()

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

Returns:
flag indicating whether this operation was successful

Project.checkLanguageFiles

checkLanguageFiles()

Public slot to check the language files after a release process.

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

deleteLanguageFile(langFile)

Public slot to delete a translation from the project directory.

langFile
the translation file to be removed (string)

Project.getActions

getActions()

Public method to get a list of all actions.

Returns:
list of all actions (list of E4Action)

Project.getDebugProperty

getDebugProperty(key)

Public method to retrieve a debugger property.

key
key of the property (string)
Returns:
value of the property

Project.getDefaultSourceExtension

getDefaultSourceExtension()

Public method to get the default extension for the project's programming language.

Returns:
default extension (including the dot) (string)

Project.getFiles

getFiles(start)

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

start
prefix (string or QString)

Project.getMainScript

getMainScript(normalized = False)

Public method to return the main script filename.

normalized
flag indicating a normalized filename is wanted (boolean)
Returns:
filename of the projects main script (string)

Project.getModel

getModel()

Public method to get a reference to the project browser model.

Returns:
reference to the project browser model (ProjectBrowserModel)

Project.getProjectLanguage

getProjectLanguage()

Public method to get the project's programming language.

Returns:
programming language (string)

Project.getProjectPath

getProjectPath()

Public method to get the project path.

Returns:
project path (string)

Project.getSources

getSources(normalized = False)

Public method to return the source script files.

normalized
flag indicating a normalized filename is wanted (boolean)
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.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Project.handlePyLint

handlePyLint()

Public slot used to check the project with pylint.

Project.handleSyntaxCheck

handleSyntaxCheck()

Public slot used to check the project files for bad syntax.

Project.handleTabnanny

handleTabnanny()

Public 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.initActions

initActions()

Public slot to initialize the project related actions.

Project.initMenu

initMenu()

Public slot to initialize the project menu.

Returns:
the menu generated (QMenu)

Project.initToolbar

initToolbar()

Public slot to initialize the project toolbar.

Returns:
the toolbar generated (QToolBar)

Project.initVCS

initVCS(vcsSystem = None)

Public 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.isProjectResource

isProjectResource(fn)

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

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, updateModel = True)

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

fn
filename or directory name added (string or QString)
updateModel
flag indicating an update of the model is requested (boolean)

Project.registerUiType

registerUiType(type_, description)

Public method to register a UI type.

type_
internal type designator to be registered (string)
description
more verbose type name (display string) (QString)

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, updateModel = True)

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
updateModel
flag indicating an update of the model is requested (boolean)

Project.removeLanguageFile

removeLanguageFile(langFile)

Public slot to remove a translation from the project.

The translation file is not deleted from the project directory.

langFile
the translation file to be removed (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.renameFileInPdata

renameFileInPdata(oldname, newname, isSourceFile = False)

Public method to rename a file in the pdata structure.

oldname
old filename (string)
newname
new filename (string)
isSourceFile
flag indicating that this is a source file even if it doesn't have the source extension (boolean)

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

repopulateItem(fullname)

Public slot to repopulate a named item.

fullname
full name of the item to repopulate (string or QString)

Project.saveAllScripts

saveAllScripts(reportSyntaxErrors = False)

Public method to save all scripts belonging to the project.

reportSyntaxErrors=
flag indicating special reporting for syntax errors (boolean)
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.setDbgInfo

setDbgInfo(argv, wd, env, excReporting, excList, autoClearShell, tracePython = None, autoContinue = 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 (QStringList)
autoClearShell
flag indicating, that the interpreter window should be cleared (boolean)
tracePython=
flag to indicate if the Python library should be traced as well (boolean)
autoContinue=
flag indicating, that the debugger should not stop at the first executable line (boolean)
covexcPattern=
regexp pattern to exclude lines from code coverage (string or QString)

Project.setDirty

setDirty(b)

Public method to set the dirty state.

It emits the signal dirty(int).

b
dirty state (boolean)

Project.unregisterUiType

unregisterUiType(type_)

Public method to unregister a UI type.

type_
internal type designator to be unregistered (string)

Up