ProjectPyramid/Documentation/source/Plugin_Project_Pyramid.ProjectPyramid.Project.html

Tue, 10 Dec 2024 15:49:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Dec 2024 15:49:00 +0100
branch
eric7
changeset 171
4a8bf0845603
parent 168
fee59283137b
permissions
-rw-r--r--

Updated copyright for 2025.

<!DOCTYPE html>
<html><head>
<title>Plugin_Project_Pyramid.ProjectPyramid.Project</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>Plugin_Project_Pyramid.ProjectPyramid.Project</h1>

<p>
Module implementing the Pyramid project support.
</p>
<h3>Global Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>

<table>

<tr>
<td><a href="#Project">Project</a></td>
<td>Class implementing the Pyramid project support.</td>
</tr>
<tr>
<td><a href="#PyramidNoProjectSelectedError">PyramidNoProjectSelectedError</a></td>
<td>Exception thrown to signal, that there is no current Pyramid project.</td>
</tr>
<tr>
<td><a href="#QProcess">QProcess</a></td>
<td>Class transforming the call arguments in case of gnome-terminal.</td>
</tr>
</table>
<h3>Functions</h3>

<table>
<tr><td>None</td></tr>
</table>
<hr />
<hr />
<a NAME="Project" ID="Project"></a>
<h2>Project</h2>

<p>
    Class implementing the Pyramid project support.
</p>
<h3>Derived from</h3>
QObject
<h3>Class Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>

<table>

<tr>
<td><a href="#Project.__init__">Project</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#Project.__adjustWorkingDirectory">__adjustWorkingDirectory</a></td>
<td>Private method to adjust the working directory in the arguments list.</td>
</tr>
<tr>
<td><a href="#Project.__assemblePyramidCommand">__assemblePyramidCommand</a></td>
<td>Private method to assemble the full pyramid command for a given virtual environment.</td>
</tr>
<tr>
<td><a href="#Project.__buildDistribution">__buildDistribution</a></td>
<td>Private slot to build a distribution file for the current Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__createMigration">__createMigration</a></td>
<td>Private slot to create a new database migration.</td>
</tr>
<tr>
<td><a href="#Project.__createProject">__createProject</a></td>
<td>Private slot to create a new Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__findProjects">__findProjects</a></td>
<td>Private method to determine the relative path of all Pyramid projects (= top level dirs).</td>
</tr>
<tr>
<td><a href="#Project.__getDebugEnvironment">__getDebugEnvironment</a></td>
<td>Private method to get the path of the debugger environment.</td>
</tr>
<tr>
<td><a href="#Project.__getExecutablePaths">__getExecutablePaths</a></td>
<td>Private method to build all full paths of an executable file from the environment.</td>
</tr>
<tr>
<td><a href="#Project.__getInitDbCommand">__getInitDbCommand</a></td>
<td>Private method to create the path to the initialization script.</td>
</tr>
<tr>
<td><a href="#Project.__getLocale">__getLocale</a></td>
<td>Private method to extract the locale out of a file name.</td>
</tr>
<tr>
<td><a href="#Project.__getVirtualEnvironment">__getVirtualEnvironment</a></td>
<td>Private method to get the path of the virtual environment.</td>
</tr>
<tr>
<td><a href="#Project.__initDatabaseActions">__initDatabaseActions</a></td>
<td>Private method to initialize the database related actions.</td>
</tr>
<tr>
<td><a href="#Project.__initializeDatabase">__initializeDatabase</a></td>
<td>Private slot to initialize the database of the Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__isSuitableForVariant">__isSuitableForVariant</a></td>
<td>Private method to test, if a detected command file is suitable for the given Python variant.</td>
</tr>
<tr>
<td><a href="#Project.__normalizeList">__normalizeList</a></td>
<td>Private method to normalize a list of file names.</td>
</tr>
<tr>
<td><a href="#Project.__project">__project</a></td>
<td>Private method to get the name of the current Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__projectFilteredList">__projectFilteredList</a></td>
<td>Private method to filter a list of file names by Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__projectLanguageAdded">__projectLanguageAdded</a></td>
<td>Private slot handling the addition of a new language.</td>
</tr>
<tr>
<td><a href="#Project.__pyramidInfo">__pyramidInfo</a></td>
<td>Private slot to show some info about Pyramid.</td>
</tr>
<tr>
<td><a href="#Project.__runBrowser">__runBrowser</a></td>
<td>Private slot to start the default web browser with the server URL.</td>
</tr>
<tr>
<td><a href="#Project.__runPythonShell">__runPythonShell</a></td>
<td>Private slot to start a Python console for a Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.__runServer">__runServer</a></td>
<td>Private slot to start the Pyramid Web server.</td>
</tr>
<tr>
<td><a href="#Project.__selectProject">__selectProject</a></td>
<td>Private method to select a Pyramid project to work with.</td>
</tr>
<tr>
<td><a href="#Project.__serverProcFinished">__serverProcFinished</a></td>
<td>Private slot connected to the finished signal.</td>
</tr>
<tr>
<td><a href="#Project.__setCurrentProject">__setCurrentProject</a></td>
<td>Private slot to set the current project.</td>
</tr>
<tr>
<td><a href="#Project.__showDocumentation">__showDocumentation</a></td>
<td>Private slot to show the helpviewer with the Pyramid documentation.</td>
</tr>
<tr>
<td><a href="#Project.__showMatchingViews">__showMatchingViews</a></td>
<td>Private slot showing all views that would match a given URL.</td>
</tr>
<tr>
<td><a href="#Project.__showMigrationsHistory">__showMigrationsHistory</a></td>
<td>Private slot to show the full migrations history.</td>
</tr>
<tr>
<td><a href="#Project.__showMigrationsSummary">__showMigrationsSummary</a></td>
<td>Private slot to show a migrations history summary.</td>
</tr>
<tr>
<td><a href="#Project.__showRoutes">__showRoutes</a></td>
<td>Private slot showing all URL dispatch routes.</td>
</tr>
<tr>
<td><a href="#Project.__showTweens">__showTweens</a></td>
<td>Private slot showing all implicit and explicit tween objects.</td>
</tr>
<tr>
<td><a href="#Project.compileCatalogs">compileCatalogs</a></td>
<td>Public method to compile the message catalogs.</td>
</tr>
<tr>
<td><a href="#Project.compileSelectedCatalogs">compileSelectedCatalogs</a></td>
<td>Public method to update the message catalogs.</td>
</tr>
<tr>
<td><a href="#Project.downgradeDatabase">downgradeDatabase</a></td>
<td>Public slot to downgrade the database to the previous or a given version.</td>
</tr>
<tr>
<td><a href="#Project.extractMessages">extractMessages</a></td>
<td>Public method to extract the messages catalog template file.</td>
</tr>
<tr>
<td><a href="#Project.getAlembicCommand">getAlembicCommand</a></td>
<td>Public method to get the path to the alembic executable of the current Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.getMenu">getMenu</a></td>
<td>Public method to get a reference to the requested menu.</td>
</tr>
<tr>
<td><a href="#Project.getMenuNames">getMenuNames</a></td>
<td>Public method to get the names of all menus.</td>
</tr>
<tr>
<td><a href="#Project.getProjectVirtualEnvironment">getProjectVirtualEnvironment</a></td>
<td>Public method to generate the path of the project virtual environment.</td>
</tr>
<tr>
<td><a href="#Project.getPyramidCommand">getPyramidCommand</a></td>
<td>Public method to build a Pyramid command.</td>
</tr>
<tr>
<td><a href="#Project.getPyramidVersion">getPyramidVersion</a></td>
<td>Public method to get the Pyramid version as a tuple.</td>
</tr>
<tr>
<td><a href="#Project.getPyramidVersionString">getPyramidVersionString</a></td>
<td>Public method to get the Pyramid version as a string.</td>
</tr>
<tr>
<td><a href="#Project.getPythonCommand">getPythonCommand</a></td>
<td>Public method to build the Python command.</td>
</tr>
<tr>
<td><a href="#Project.initActions">initActions</a></td>
<td>Public method to define the Pyramid actions.</td>
</tr>
<tr>
<td><a href="#Project.initMenu">initMenu</a></td>
<td>Public slot to initialize the Pyramid menu.</td>
</tr>
<tr>
<td><a href="#Project.isSpawningConsole">isSpawningConsole</a></td>
<td>Public method to check, if the given console is a spawning console.</td>
</tr>
<tr>
<td><a href="#Project.migrationsPath">migrationsPath</a></td>
<td>Public method to get the path to the migrations directory of the current Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.newForm">newForm</a></td>
<td>Public method to create a new form.</td>
</tr>
<tr>
<td><a href="#Project.openPOEditor">openPOEditor</a></td>
<td>Public method to edit the given file in an external .po editor.</td>
</tr>
<tr>
<td><a href="#Project.projectClosed">projectClosed</a></td>
<td>Public method to handle the closing of a project.</td>
</tr>
<tr>
<td><a href="#Project.projectClosedHooks">projectClosedHooks</a></td>
<td>Public method to remove our hook methods.</td>
</tr>
<tr>
<td><a href="#Project.projectOpenedHooks">projectOpenedHooks</a></td>
<td>Public method to add our hook methods.</td>
</tr>
<tr>
<td><a href="#Project.projectPath">projectPath</a></td>
<td>Public method to calculate the full path of the Pyramid project.</td>
</tr>
<tr>
<td><a href="#Project.registerOpenHook">registerOpenHook</a></td>
<td>Public method to register the open hook to open a translations file in a translations editor.</td>
</tr>
<tr>
<td><a href="#Project.supportedPythonVariants">supportedPythonVariants</a></td>
<td>Public method to get the supported Python variants.</td>
</tr>
<tr>
<td><a href="#Project.updateCatalogs">updateCatalogs</a></td>
<td>Public method to update the message catalogs.</td>
</tr>
<tr>
<td><a href="#Project.updateSelectedCatalogs">updateSelectedCatalogs</a></td>
<td>Public method to update the message catalogs.</td>
</tr>
<tr>
<td><a href="#Project.upgradeDatabase">upgradeDatabase</a></td>
<td>Public slot to upgrade the database to the head or a given version.</td>
</tr>
</table>
<h3>Static Methods</h3>

<table>
<tr><td>None</td></tr>
</table>

<a NAME="Project.__init__" ID="Project.__init__"></a>
<h4>Project (Constructor)</h4>
<b>Project</b>(<i>plugin, iconSuffix, parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>plugin</i> (ProjectPyramidPlugin)</dt>
<dd>
reference to the plugin object
</dd>
<dt><i>iconSuffix</i> (str)</dt>
<dd>
suffix for the icons
</dd>
<dt><i>parent</i> (QObject)</dt>
<dd>
parent
</dd>
</dl>
<a NAME="Project.__adjustWorkingDirectory" ID="Project.__adjustWorkingDirectory"></a>
<h4>Project.__adjustWorkingDirectory</h4>
<b>__adjustWorkingDirectory</b>(<i>args, wd</i>)

<p>
        Private method to adjust the working directory in the arguments list.
</p>
<dl>

<dt><i>args</i> (list of str)</dt>
<dd>
list of arguments to be modified
</dd>
<dt><i>wd</i> (str)</dt>
<dd>
working directory
</dd>
</dl>
<a NAME="Project.__assemblePyramidCommand" ID="Project.__assemblePyramidCommand"></a>
<h4>Project.__assemblePyramidCommand</h4>
<b>__assemblePyramidCommand</b>(<i>cmd, virtualEnv</i>)

<p>
        Private method to assemble the full pyramid command for a given virtual
        environment.
</p>
<dl>

<dt><i>cmd</i> (str)</dt>
<dd>
command
</dd>
<dt><i>virtualEnv</i> (str)</dt>
<dd>
path of the project's Python virtual environment
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
assembled pyramid command
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.__buildDistribution" ID="Project.__buildDistribution"></a>
<h4>Project.__buildDistribution</h4>
<b>__buildDistribution</b>(<i></i>)

<p>
        Private slot to build a distribution file for the current Pyramid
        project.
</p>
<a NAME="Project.__createMigration" ID="Project.__createMigration"></a>
<h4>Project.__createMigration</h4>
<b>__createMigration</b>(<i></i>)

<p>
        Private slot to create a new database migration.
</p>
<a NAME="Project.__createProject" ID="Project.__createProject"></a>
<h4>Project.__createProject</h4>
<b>__createProject</b>(<i></i>)

<p>
        Private slot to create a new Pyramid project.
</p>
<a NAME="Project.__findProjects" ID="Project.__findProjects"></a>
<h4>Project.__findProjects</h4>
<b>__findProjects</b>(<i></i>)

<p>
        Private method to determine the relative path of all Pyramid
        projects (= top level dirs).
</p>
<dl>
<dt>Return:</dt>
<dd>
list of projects
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.__getDebugEnvironment" ID="Project.__getDebugEnvironment"></a>
<h4>Project.__getDebugEnvironment</h4>
<b>__getDebugEnvironment</b>(<i>language=""</i>)

<p>
        Private method to get the path of the debugger environment.
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
Python variant to get the debugger environment
            for (one of '' or 'Python3')
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
path of the debugger environment
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.__getExecutablePaths" ID="Project.__getExecutablePaths"></a>
<h4>Project.__getExecutablePaths</h4>
<b>__getExecutablePaths</b>(<i>file</i>)

<p>
        Private method to build all full paths of an executable file from
        the environment.
</p>
<dl>

<dt><i>file</i> (str)</dt>
<dd>
filename of the executable
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of full executable names, if the executable file is
            accessible via the searchpath defined by the PATH environment
            variable, or an empty list otherwise.
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.__getInitDbCommand" ID="Project.__getInitDbCommand"></a>
<h4>Project.__getInitDbCommand</h4>
<b>__getInitDbCommand</b>(<i></i>)

<p>
        Private method to create the path to the initialization script.
</p>
<dl>
<dt>Return:</dt>
<dd>
path to the initialization script
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.__getLocale" ID="Project.__getLocale"></a>
<h4>Project.__getLocale</h4>
<b>__getLocale</b>(<i>filename</i>)

<p>
        Private method to extract the locale out of a file name.
</p>
<dl>

<dt><i>filename</i> (str)</dt>
<dd>
name of the file used for extraction
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
extracted locale or None
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.__getVirtualEnvironment" ID="Project.__getVirtualEnvironment"></a>
<h4>Project.__getVirtualEnvironment</h4>
<b>__getVirtualEnvironment</b>(<i>language=""</i>)

<p>
        Private method to get the path of the virtual environment.
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
Python variant to get the virtual environment
            for (one of '' or 'Python3')
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
path of the virtual environment
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.__initDatabaseActions" ID="Project.__initDatabaseActions"></a>
<h4>Project.__initDatabaseActions</h4>
<b>__initDatabaseActions</b>(<i></i>)

<p>
        Private method to initialize the database related actions.
</p>
<a NAME="Project.__initializeDatabase" ID="Project.__initializeDatabase"></a>
<h4>Project.__initializeDatabase</h4>
<b>__initializeDatabase</b>(<i></i>)

<p>
        Private slot to initialize the database of the Pyramid project.
</p>
<a NAME="Project.__isSuitableForVariant" ID="Project.__isSuitableForVariant"></a>
<h4>Project.__isSuitableForVariant</h4>
<b>__isSuitableForVariant</b>(<i>variant, line0</i>)

<p>
        Private method to test, if a detected command file is suitable for the
        given Python variant.
</p>
<dl>

<dt><i>variant</i> (str)</dt>
<dd>
Python variant to test for
</dd>
<dt><i>line0</i> (str)</dt>
<dd>
first line of the executable
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating a suitable command
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="Project.__normalizeList" ID="Project.__normalizeList"></a>
<h4>Project.__normalizeList</h4>
<b>__normalizeList</b>(<i>filenames</i>)

<p>
        Private method to normalize a list of file names.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of file names to normalize
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
normalized file names
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.__project" ID="Project.__project"></a>
<h4>Project.__project</h4>
<b>__project</b>(<i></i>)

<p>
        Private method to get the name of the current Pyramid project.
</p>
<dl>
<dt>Return:</dt>
<dd>
name of the project
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<dl>

<dt>Raises <b>PyramidNoProjectSelectedError</b>:</dt>
<dd>
raised, if no project is
            selected
</dd>
</dl>
<a NAME="Project.__projectFilteredList" ID="Project.__projectFilteredList"></a>
<h4>Project.__projectFilteredList</h4>
<b>__projectFilteredList</b>(<i>filenames</i>)

<p>
        Private method to filter a list of file names by Pyramid project.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of file names to be filtered
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
file names belonging to the current site
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.__projectLanguageAdded" ID="Project.__projectLanguageAdded"></a>
<h4>Project.__projectLanguageAdded</h4>
<b>__projectLanguageAdded</b>(<i>code</i>)

<p>
        Private slot handling the addition of a new language.
</p>
<dl>

<dt><i>code</i> (str)</dt>
<dd>
language code of the new language
</dd>
</dl>
<a NAME="Project.__pyramidInfo" ID="Project.__pyramidInfo"></a>
<h4>Project.__pyramidInfo</h4>
<b>__pyramidInfo</b>(<i></i>)

<p>
        Private slot to show some info about Pyramid.
</p>
<a NAME="Project.__runBrowser" ID="Project.__runBrowser"></a>
<h4>Project.__runBrowser</h4>
<b>__runBrowser</b>(<i></i>)

<p>
        Private slot to start the default web browser with the server URL.
</p>
<a NAME="Project.__runPythonShell" ID="Project.__runPythonShell"></a>
<h4>Project.__runPythonShell</h4>
<b>__runPythonShell</b>(<i></i>)

<p>
        Private slot to start a Python console for a Pyramid project.
</p>
<a NAME="Project.__runServer" ID="Project.__runServer"></a>
<h4>Project.__runServer</h4>
<b>__runServer</b>(<i></i>)

<p>
        Private slot to start the Pyramid Web server.
</p>
<a NAME="Project.__selectProject" ID="Project.__selectProject"></a>
<h4>Project.__selectProject</h4>
<b>__selectProject</b>(<i></i>)

<p>
        Private method to select a Pyramid project to work with.
</p>
<a NAME="Project.__serverProcFinished" ID="Project.__serverProcFinished"></a>
<h4>Project.__serverProcFinished</h4>
<b>__serverProcFinished</b>(<i></i>)

<p>
        Private slot connected to the finished signal.
</p>
<a NAME="Project.__setCurrentProject" ID="Project.__setCurrentProject"></a>
<h4>Project.__setCurrentProject</h4>
<b>__setCurrentProject</b>(<i>project</i>)

<p>
        Private slot to set the current project.
</p>
<dl>

<dt><i>project</i> (str)</dt>
<dd>
name of the project
</dd>
</dl>
<a NAME="Project.__showDocumentation" ID="Project.__showDocumentation"></a>
<h4>Project.__showDocumentation</h4>
<b>__showDocumentation</b>(<i></i>)

<p>
        Private slot to show the helpviewer with the Pyramid documentation.
</p>
<a NAME="Project.__showMatchingViews" ID="Project.__showMatchingViews"></a>
<h4>Project.__showMatchingViews</h4>
<b>__showMatchingViews</b>(<i></i>)

<p>
        Private slot showing all views that would match a given URL.
</p>
<a NAME="Project.__showMigrationsHistory" ID="Project.__showMigrationsHistory"></a>
<h4>Project.__showMigrationsHistory</h4>
<b>__showMigrationsHistory</b>(<i></i>)

<p>
        Private slot to show the full migrations history.
</p>
<a NAME="Project.__showMigrationsSummary" ID="Project.__showMigrationsSummary"></a>
<h4>Project.__showMigrationsSummary</h4>
<b>__showMigrationsSummary</b>(<i></i>)

<p>
        Private slot to show a migrations history summary.
</p>
<a NAME="Project.__showRoutes" ID="Project.__showRoutes"></a>
<h4>Project.__showRoutes</h4>
<b>__showRoutes</b>(<i></i>)

<p>
        Private slot showing all URL dispatch routes.
</p>
<a NAME="Project.__showTweens" ID="Project.__showTweens"></a>
<h4>Project.__showTweens</h4>
<b>__showTweens</b>(<i></i>)

<p>
        Private slot showing all implicit and explicit tween objects.
</p>
<a NAME="Project.compileCatalogs" ID="Project.compileCatalogs"></a>
<h4>Project.compileCatalogs</h4>
<b>compileCatalogs</b>(<i>filenames</i>)

<p>
        Public method to compile the message catalogs.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of filenames (not used)
</dd>
</dl>
<a NAME="Project.compileSelectedCatalogs" ID="Project.compileSelectedCatalogs"></a>
<h4>Project.compileSelectedCatalogs</h4>
<b>compileSelectedCatalogs</b>(<i>filenames</i>)

<p>
        Public method to update the message catalogs.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of file names
</dd>
</dl>
<a NAME="Project.downgradeDatabase" ID="Project.downgradeDatabase"></a>
<h4>Project.downgradeDatabase</h4>
<b>downgradeDatabase</b>(<i>revision=None</i>)

<p>
        Public slot to downgrade the database to the previous or a given
        version.
</p>
<dl>

<dt><i>revision</i> (str)</dt>
<dd>
migration revision to downgrade to
</dd>
</dl>
<a NAME="Project.extractMessages" ID="Project.extractMessages"></a>
<h4>Project.extractMessages</h4>
<b>extractMessages</b>(<i></i>)

<p>
        Public method to extract the messages catalog template file.
</p>
<a NAME="Project.getAlembicCommand" ID="Project.getAlembicCommand"></a>
<h4>Project.getAlembicCommand</h4>
<b>getAlembicCommand</b>(<i></i>)

<p>
        Public method to get the path to the alembic executable of the current
        Pyramid project.
</p>
<dl>
<dt>Return:</dt>
<dd>
path to the alembic executable
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.getMenu" ID="Project.getMenu"></a>
<h4>Project.getMenu</h4>
<b>getMenu</b>(<i>name</i>)

<p>
        Public method to get a reference to the requested menu.
</p>
<dl>

<dt><i>name</i> (str)</dt>
<dd>
name of the menu
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
reference to the menu or None, if no menu with the given
            name exists
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
QMenu
</dd>
</dl>
<a NAME="Project.getMenuNames" ID="Project.getMenuNames"></a>
<h4>Project.getMenuNames</h4>
<b>getMenuNames</b>(<i></i>)

<p>
        Public method to get the names of all menus.
</p>
<dl>
<dt>Return:</dt>
<dd>
menu names
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.getProjectVirtualEnvironment" ID="Project.getProjectVirtualEnvironment"></a>
<h4>Project.getProjectVirtualEnvironment</h4>
<b>getProjectVirtualEnvironment</b>(<i></i>)

<p>
        Public method to generate the path of the project virtual environment.
</p>
<dl>
<dt>Return:</dt>
<dd>
path of the Pyramid project virtual environment
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.getPyramidCommand" ID="Project.getPyramidCommand"></a>
<h4>Project.getPyramidCommand</h4>
<b>getPyramidCommand</b>(<i>cmd, language="", virtualEnv=""</i>)

<p>
        Public method to build a Pyramid command.
</p>
<dl>

<dt><i>cmd</i> (str)</dt>
<dd>
command
</dd>
<dt><i>language</i> (str)</dt>
<dd>
Python variant to get the virtual environment
            for (one of '' or 'Python3')
</dd>
<dt><i>virtualEnv</i> (str)</dt>
<dd>
path of the project's Python virtual environment
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
full pyramid command
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.getPyramidVersion" ID="Project.getPyramidVersion"></a>
<h4>Project.getPyramidVersion</h4>
<b>getPyramidVersion</b>(<i></i>)

<p>
        Public method to get the Pyramid version as a tuple.
</p>
<dl>
<dt>Return:</dt>
<dd>
Pyramid version
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
tuple of int
</dd>
</dl>
<a NAME="Project.getPyramidVersionString" ID="Project.getPyramidVersionString"></a>
<h4>Project.getPyramidVersionString</h4>
<b>getPyramidVersionString</b>(<i></i>)

<p>
        Public method to get the Pyramid version as a string.
</p>
<dl>
<dt>Return:</dt>
<dd>
Pyramid version
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.getPythonCommand" ID="Project.getPythonCommand"></a>
<h4>Project.getPythonCommand</h4>
<b>getPythonCommand</b>(<i></i>)

<p>
        Public method to build the Python command.
</p>
<dl>
<dt>Return:</dt>
<dd>
python command
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.initActions" ID="Project.initActions"></a>
<h4>Project.initActions</h4>
<b>initActions</b>(<i></i>)

<p>
        Public method to define the Pyramid actions.
</p>
<a NAME="Project.initMenu" ID="Project.initMenu"></a>
<h4>Project.initMenu</h4>
<b>initMenu</b>(<i></i>)

<p>
        Public slot to initialize the Pyramid menu.
</p>
<dl>
<dt>Return:</dt>
<dd>
the menu generated
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
QMenu
</dd>
</dl>
<a NAME="Project.isSpawningConsole" ID="Project.isSpawningConsole"></a>
<h4>Project.isSpawningConsole</h4>
<b>isSpawningConsole</b>(<i>consoleCmd</i>)

<p>
        Public method to check, if the given console is a spawning console.
</p>
<dl>

<dt><i>consoleCmd</i> (str)</dt>
<dd>
console command
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple of two entries giving an indication, if the console
            is spawning (boolean) and the (possibly) cleaned console command
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.migrationsPath" ID="Project.migrationsPath"></a>
<h4>Project.migrationsPath</h4>
<b>migrationsPath</b>(<i></i>)

<p>
        Public method to get the path to the migrations directory of the
        current Pyramid project.
</p>
<dl>
<dt>Return:</dt>
<dd>
pathof the directory containing the migrations
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="Project.newForm" ID="Project.newForm"></a>
<h4>Project.newForm</h4>
<b>newForm</b>(<i>path</i>)

<p>
        Public method to create a new form.
</p>
<dl>

<dt><i>path</i> (str)</dt>
<dd>
full directory path for the new form file
</dd>
</dl>
<a NAME="Project.openPOEditor" ID="Project.openPOEditor"></a>
<h4>Project.openPOEditor</h4>
<b>openPOEditor</b>(<i>poFile</i>)

<p>
        Public method to edit the given file in an external .po editor.
</p>
<dl>

<dt><i>poFile</i> (str)</dt>
<dd>
name of the .po file
</dd>
</dl>
<a NAME="Project.projectClosed" ID="Project.projectClosed"></a>
<h4>Project.projectClosed</h4>
<b>projectClosed</b>(<i></i>)

<p>
        Public method to handle the closing of a project.
</p>
<a NAME="Project.projectClosedHooks" ID="Project.projectClosedHooks"></a>
<h4>Project.projectClosedHooks</h4>
<b>projectClosedHooks</b>(<i></i>)

<p>
        Public method to remove our hook methods.
</p>
<a NAME="Project.projectOpenedHooks" ID="Project.projectOpenedHooks"></a>
<h4>Project.projectOpenedHooks</h4>
<b>projectOpenedHooks</b>(<i></i>)

<p>
        Public method to add our hook methods.
</p>
<a NAME="Project.projectPath" ID="Project.projectPath"></a>
<h4>Project.projectPath</h4>
<b>projectPath</b>(<i></i>)

<p>
        Public method to calculate the full path of the Pyramid project.
</p>
<dl>
<dt>Return:</dt>
<dd>
path of the project
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<dl>

<dt>Raises <b>PyramidNoProjectSelectedError</b>:</dt>
<dd>
raised, if no project is
            selected
</dd>
</dl>
<a NAME="Project.registerOpenHook" ID="Project.registerOpenHook"></a>
<h4>Project.registerOpenHook</h4>
<b>registerOpenHook</b>(<i></i>)

<p>
        Public method to register the open hook to open a translations file
        in a translations editor.
</p>
<a NAME="Project.supportedPythonVariants" ID="Project.supportedPythonVariants"></a>
<h4>Project.supportedPythonVariants</h4>
<b>supportedPythonVariants</b>(<i></i>)

<p>
        Public method to get the supported Python variants.
</p>
<dl>
<dt>Return:</dt>
<dd>
list of supported Python variants
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="Project.updateCatalogs" ID="Project.updateCatalogs"></a>
<h4>Project.updateCatalogs</h4>
<b>updateCatalogs</b>(<i>filenames</i>)

<p>
        Public method to update the message catalogs.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of filenames (not used)
</dd>
</dl>
<a NAME="Project.updateSelectedCatalogs" ID="Project.updateSelectedCatalogs"></a>
<h4>Project.updateSelectedCatalogs</h4>
<b>updateSelectedCatalogs</b>(<i>filenames</i>)

<p>
        Public method to update the message catalogs.
</p>
<dl>

<dt><i>filenames</i> (list of str)</dt>
<dd>
list of filenames
</dd>
</dl>
<a NAME="Project.upgradeDatabase" ID="Project.upgradeDatabase"></a>
<h4>Project.upgradeDatabase</h4>
<b>upgradeDatabase</b>(<i>revision=None</i>)

<p>
        Public slot to upgrade the database to the head or a given version.
</p>
<dl>

<dt><i>revision</i> (str)</dt>
<dd>
migration revision to upgrade to
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="PyramidNoProjectSelectedError" ID="PyramidNoProjectSelectedError"></a>
<h2>PyramidNoProjectSelectedError</h2>

<p>
    Exception thrown to signal, that there is no current Pyramid project.
</p>
<h3>Derived from</h3>
Exception
<h3>Class Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Static Methods</h3>

<table>
<tr><td>None</td></tr>
</table>

<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="QProcess" ID="QProcess"></a>
<h2>QProcess</h2>

<p>
    Class transforming the call arguments in case of gnome-terminal.
</p>
<h3>Derived from</h3>
QProcessPyQt
<h3>Class Attributes</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>

<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>

<table>

<tr>
<td><a href="#QProcess.start">start</a></td>
<td>Public method to start the given program (cmd) in a new process, if none is already running, passing the command line arguments in args.</td>
</tr>
</table>
<h3>Static Methods</h3>

<table>

<tr>
<td><a href="#QProcess.startDetached">startDetached</a></td>
<td>Public static method to start the given program (cmd) in a new process, if none is already running, passing the command line arguments in args.</td>
</tr>
</table>

<a NAME="QProcess.start" ID="QProcess.start"></a>
<h4>QProcess.start</h4>
<b>start</b>(<i>cmd, args=None, mode=QIODeviceBase.OpenModeFlag.ReadWrite</i>)

<p>
        Public method to start the given program (cmd) in a new process, if
        none is already running, passing the command line arguments in args.
</p>
<dl>

<dt><i>cmd</i> (str)</dt>
<dd>
start the given program cmd
</dd>
<dt><i>args</i> (list of str)</dt>
<dd>
list of parameters
</dd>
<dt><i>mode</i> (QIODeviceBase.OpenMode)</dt>
<dd>
access mode
</dd>
</dl>
<a NAME="QProcess.startDetached" ID="QProcess.startDetached"></a>
<h4>QProcess.startDetached (static)</h4>
<b>startDetached</b>(<i>args=None, path=""</i>)

<p>
        Public static method to start the given program (cmd) in a new process,
        if none is already running, passing the command line arguments in args.
</p>
<dl>

<dt><i>cmd</i> (str)</dt>
<dd>
start the given program cmd
</dd>
<dt><i>args</i> (list of str)</dt>
<dd>
list of parameters
</dd>
<dt><i>path</i> (str)</dt>
<dd>
new working directory
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
tuple of successful start and process id
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
tuple of (bool, int)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial