AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html

Tue, 25 May 2021 17:48:25 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 25 May 2021 17:48:25 +0200
branch
eric7
changeset 180
89ff060ef0d9
parent 177
25cb41783971
child 193
e1b0e65903d9
permissions
-rw-r--r--

Ported the plug-in to PyQt6 for eric7.

<!DOCTYPE html>
<html><head>
<title>Plugin_Assistant_Eric.AssistantEric.APIsManager</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body>
<a NAME="top" ID="top"></a>
<h1>Plugin_Assistant_Eric.AssistantEric.APIsManager</h1>

<p>
Module implementing the APIsManager.
</p>
<h3>Global Attributes</h3>

<table>
<tr><td>ApisNameProject</td></tr><tr><td>WorkerStatusAborted</td></tr><tr><td>WorkerStatusFile</td></tr><tr><td>WorkerStatusFinished</td></tr><tr><td>WorkerStatusStarted</td></tr>
</table>
<h3>Classes</h3>

<table>

<tr>
<td><a href="#APIsManager">APIsManager</a></td>
<td>Class implementing the APIsManager class, which is the central store for API information used by autocompletion and calltips.</td>
</tr>
<tr>
<td><a href="#DbAPIs">DbAPIs</a></td>
<td>Class implementing an API storage entity.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker">DbAPIsWorker</a></td>
<td>Class implementing a worker thread to prepare the API database.</td>
</tr>
</table>
<h3>Functions</h3>

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

<p>
    Class implementing the APIsManager class, which is the central store for
    API information used by autocompletion and calltips.
</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="#APIsManager.__init__">APIsManager</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#APIsManager.__apiPreparationStatus">__apiPreparationStatus</a></td>
<td>Private slot handling the preparation status signal of an API object.</td>
</tr>
<tr>
<td><a href="#APIsManager.__showMessage">__showMessage</a></td>
<td>Private message to show a message in the main windows status bar.</td>
</tr>
<tr>
<td><a href="#APIsManager.deactivate">deactivate</a></td>
<td>Public method to perform actions upon deactivation.</td>
</tr>
<tr>
<td><a href="#APIsManager.getAPIs">getAPIs</a></td>
<td>Public method to get an apis object for autocompletion/calltips.</td>
</tr>
<tr>
<td><a href="#APIsManager.reloadAPIs">reloadAPIs</a></td>
<td>Public slot to reload the api information.</td>
</tr>
</table>
<h3>Static Methods</h3>

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

<a NAME="APIsManager.__init__" ID="APIsManager.__init__"></a>
<h4>APIsManager (Constructor)</h4>
<b>APIsManager</b>(<i>mainWindow, parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>mainWindow</i> (QMainWindow)</dt>
<dd>
reference to the main eric7 window
</dd>
<dt><i>parent</i> (QObject)</dt>
<dd>
reference to the parent object
</dd>
</dl>
<a NAME="APIsManager.__apiPreparationStatus" ID="APIsManager.__apiPreparationStatus"></a>
<h4>APIsManager.__apiPreparationStatus</h4>
<b>__apiPreparationStatus</b>(<i>language, status, filename</i>)

<p>
        Private slot handling the preparation status signal of an API object.
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
language of the API
</dd>
<dt><i>status</i> (int)</dt>
<dd>
preparation status (one of WorkerStatus...)
</dd>
<dt><i>filename</i> (str)</dt>
<dd>
name of the file being processed
</dd>
</dl>
<a NAME="APIsManager.__showMessage" ID="APIsManager.__showMessage"></a>
<h4>APIsManager.__showMessage</h4>
<b>__showMessage</b>(<i>msg</i>)

<p>
        Private message to show a message in the main windows status bar.
</p>
<dl>

<dt><i>msg</i> (str)</dt>
<dd>
message to be shown
</dd>
</dl>
<a NAME="APIsManager.deactivate" ID="APIsManager.deactivate"></a>
<h4>APIsManager.deactivate</h4>
<b>deactivate</b>(<i></i>)

<p>
        Public method to perform actions upon deactivation.
</p>
<a NAME="APIsManager.getAPIs" ID="APIsManager.getAPIs"></a>
<h4>APIsManager.getAPIs</h4>
<b>getAPIs</b>(<i>language, projectType=""</i>)

<p>
        Public method to get an apis object for autocompletion/calltips.
</p>
<p>
        This method creates and loads an APIs object dynamically upon request.
        This saves memory for languages, that might not be needed at the
        moment.
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
language of the requested APIs object
</dd>
<dt><i>projectType</i> (str)</dt>
<dd>
type of the project
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
reference to the APIs object
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
APIs
</dd>
</dl>
<a NAME="APIsManager.reloadAPIs" ID="APIsManager.reloadAPIs"></a>
<h4>APIsManager.reloadAPIs</h4>
<b>reloadAPIs</b>(<i></i>)

<p>
        Public slot to reload the api information.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="DbAPIs" ID="DbAPIs"></a>
<h2>DbAPIs</h2>

<p>
    Class implementing an API storage entity.
</p>
<h3>Signals</h3>
<dl>

<dt>apiPreparationStatus(language, status, file)</dt>
<dd>
emitted to indicate
        the API preparation status for a language
</dd>
</dl>
<h3>Derived from</h3>
QObject
<h3>Class Attributes</h3>

<table>
<tr><td>DB_VERSION</td></tr><tr><td>ac_context_stmt</td></tr><tr><td>ac_context_word_stmt</td></tr><tr><td>ac_stmt</td></tr><tr><td>api_files_stmt</td></tr><tr><td>bases_stmt</td></tr><tr><td>create_acWord_idx</td></tr><tr><td>create_api_stmt</td></tr><tr><td>create_bases_idx</td></tr><tr><td>create_bases_stmt</td></tr><tr><td>create_context_idx</td></tr><tr><td>create_file_idx</td></tr><tr><td>create_file_stmt</td></tr><tr><td>create_fullContext_idx</td></tr><tr><td>create_mgmt_stmt</td></tr><tr><td>ct_context_stmt</td></tr><tr><td>ct_fullContext_stmt</td></tr><tr><td>ct_stmt</td></tr><tr><td>drop_acWord_idx</td></tr><tr><td>drop_api_stmt</td></tr><tr><td>drop_bases_idx</td></tr><tr><td>drop_bases_stmt</td></tr><tr><td>drop_context_idx</td></tr><tr><td>drop_file_idx</td></tr><tr><td>drop_file_stmt</td></tr><tr><td>drop_fullContext_idx</td></tr><tr><td>drop_mgmt_stmt</td></tr><tr><td>format_select_stmt</td></tr><tr><td>mgmt_insert_stmt</td></tr>
</table>
<h3>Class Methods</h3>

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

<table>

<tr>
<td><a href="#DbAPIs.__init__">DbAPIs</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#DbAPIs.__createApiDB">__createApiDB</a></td>
<td>Private method to create an API database.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__enoughCommas">__enoughCommas</a></td>
<td>Private method to determine, if the given string contains enough commas.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__getProjectFormSources">__getProjectFormSources</a></td>
<td>Private method to get the source files for the project forms.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__initAsLanguage">__initAsLanguage</a></td>
<td>Private method to initialize as a language API object.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__initAsProject">__initAsProject</a></td>
<td>Private method to initialize as a project API object.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__isPrepared">__isPrepared</a></td>
<td>Private method to check, if the database has been prepared.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__openAPIs">__openAPIs</a></td>
<td>Private method to open the API database.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__openApiDb">__openApiDb</a></td>
<td>Private method to open the API database.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__processQueue">__processQueue</a></td>
<td>Private slot to process the queue of files to load.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__processingStatus">__processingStatus</a></td>
<td>Private slot handling the processing signal of the API preparation thread.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__projectChanged">__projectChanged</a></td>
<td>Private slot to handle the projectChanged signal.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__projectClosed">__projectClosed</a></td>
<td>Private slot to perform actions after a project has been closed.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__projectFormCompiled">__projectFormCompiled</a></td>
<td>Private slot to handle the projectFormCompiled signal.</td>
</tr>
<tr>
<td><a href="#DbAPIs.__projectOpened">__projectOpened</a></td>
<td>Private slot to perform actions after a project has been opened.</td>
</tr>
<tr>
<td><a href="#DbAPIs._apiDbName">_apiDbName</a></td>
<td>Protected method to determine the name of the database file.</td>
</tr>
<tr>
<td><a href="#DbAPIs.autoCompletionWordSeparators">autoCompletionWordSeparators</a></td>
<td>Public method to get the word separator characters.</td>
</tr>
<tr>
<td><a href="#DbAPIs.close">close</a></td>
<td>Public method to close the database.</td>
</tr>
<tr>
<td><a href="#DbAPIs.editorSaved">editorSaved</a></td>
<td>Public slot to handle the editorSaved signal.</td>
</tr>
<tr>
<td><a href="#DbAPIs.getApiFiles">getApiFiles</a></td>
<td>Public method to get a list of API files loaded into the database.</td>
</tr>
<tr>
<td><a href="#DbAPIs.getCalltips">getCalltips</a></td>
<td>Public method to determine the calltips.</td>
</tr>
<tr>
<td><a href="#DbAPIs.getCompletions">getCompletions</a></td>
<td>Public method to determine the possible completions.</td>
</tr>
<tr>
<td><a href="#DbAPIs.getLexer">getLexer</a></td>
<td>Public method to return a reference to our lexer object.</td>
</tr>
<tr>
<td><a href="#DbAPIs.prepareAPIs">prepareAPIs</a></td>
<td>Public method to prepare the APIs if neccessary.</td>
</tr>
</table>
<h3>Static Methods</h3>

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

<a NAME="DbAPIs.__init__" ID="DbAPIs.__init__"></a>
<h4>DbAPIs (Constructor)</h4>
<b>DbAPIs</b>(<i>language, projectType="", parent=None</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
language of the APIs object
</dd>
<dt><i>projectType</i> (str)</dt>
<dd>
type of the project
</dd>
<dt><i>parent</i> (QObject)</dt>
<dd>
reference to the parent object
</dd>
</dl>
<a NAME="DbAPIs.__createApiDB" ID="DbAPIs.__createApiDB"></a>
<h4>DbAPIs.__createApiDB</h4>
<b>__createApiDB</b>(<i></i>)

<p>
        Private method to create an API database.
</p>
<a NAME="DbAPIs.__enoughCommas" ID="DbAPIs.__enoughCommas"></a>
<h4>DbAPIs.__enoughCommas</h4>
<b>__enoughCommas</b>(<i>s, commas</i>)

<p>
        Private method to determine, if the given string contains enough
        commas.
</p>
<dl>

<dt><i>s</i> (str)</dt>
<dd>
string to check
</dd>
<dt><i>commas</i> (int)</dt>
<dd>
number of commas to check for
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
flag indicating, that there are enough commas
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="DbAPIs.__getProjectFormSources" ID="DbAPIs.__getProjectFormSources"></a>
<h4>DbAPIs.__getProjectFormSources</h4>
<b>__getProjectFormSources</b>(<i>normalized=False</i>)

<p>
        Private method to get the source files for the project forms.
</p>
<dl>

<dt><i>normalized</i> (bool)</dt>
<dd>
flag indicating a normalized filename is wanted
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of project form sources
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIs.__initAsLanguage" ID="DbAPIs.__initAsLanguage"></a>
<h4>DbAPIs.__initAsLanguage</h4>
<b>__initAsLanguage</b>(<i></i>)

<p>
        Private method to initialize as a language API object.
</p>
<a NAME="DbAPIs.__initAsProject" ID="DbAPIs.__initAsProject"></a>
<h4>DbAPIs.__initAsProject</h4>
<b>__initAsProject</b>(<i></i>)

<p>
        Private method to initialize as a project API object.
</p>
<a NAME="DbAPIs.__isPrepared" ID="DbAPIs.__isPrepared"></a>
<h4>DbAPIs.__isPrepared</h4>
<b>__isPrepared</b>(<i></i>)

<p>
        Private method to check, if the database has been prepared.
</p>
<dl>
<dt>Return:</dt>
<dd>
flag indicating the prepared status
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="DbAPIs.__openAPIs" ID="DbAPIs.__openAPIs"></a>
<h4>DbAPIs.__openAPIs</h4>
<b>__openAPIs</b>(<i></i>)

<p>
        Private method to open the API database.
</p>
<a NAME="DbAPIs.__openApiDb" ID="DbAPIs.__openApiDb"></a>
<h4>DbAPIs.__openApiDb</h4>
<b>__openApiDb</b>(<i></i>)

<p>
        Private method to open the API database.
</p>
<dl>
<dt>Return:</dt>
<dd>
flag indicating the database status
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl>
<a NAME="DbAPIs.__processQueue" ID="DbAPIs.__processQueue"></a>
<h4>DbAPIs.__processQueue</h4>
<b>__processQueue</b>(<i></i>)

<p>
        Private slot to process the queue of files to load.
</p>
<a NAME="DbAPIs.__processingStatus" ID="DbAPIs.__processingStatus"></a>
<h4>DbAPIs.__processingStatus</h4>
<b>__processingStatus</b>(<i>status, filename</i>)

<p>
        Private slot handling the processing signal of the API preparation
        thread.
</p>
<dl>

<dt><i>status</i> (int)</dt>
<dd>
preparation status (one of WorkerStatus...)
</dd>
<dt><i>filename</i> (str)</dt>
<dd>
name of the file being processed
</dd>
</dl>
<a NAME="DbAPIs.__projectChanged" ID="DbAPIs.__projectChanged"></a>
<h4>DbAPIs.__projectChanged</h4>
<b>__projectChanged</b>(<i></i>)

<p>
        Private slot to handle the projectChanged signal.
</p>
<a NAME="DbAPIs.__projectClosed" ID="DbAPIs.__projectClosed"></a>
<h4>DbAPIs.__projectClosed</h4>
<b>__projectClosed</b>(<i></i>)

<p>
        Private slot to perform actions after a project has been closed.
</p>
<a NAME="DbAPIs.__projectFormCompiled" ID="DbAPIs.__projectFormCompiled"></a>
<h4>DbAPIs.__projectFormCompiled</h4>
<b>__projectFormCompiled</b>(<i>filename</i>)

<p>
        Private slot to handle the projectFormCompiled signal.
</p>
<dl>

<dt><i>filename</i> (str)</dt>
<dd>
name of the form file that was compiled
</dd>
</dl>
<a NAME="DbAPIs.__projectOpened" ID="DbAPIs.__projectOpened"></a>
<h4>DbAPIs.__projectOpened</h4>
<b>__projectOpened</b>(<i></i>)

<p>
        Private slot to perform actions after a project has been opened.
</p>
<a NAME="DbAPIs._apiDbName" ID="DbAPIs._apiDbName"></a>
<h4>DbAPIs._apiDbName</h4>
<b>_apiDbName</b>(<i></i>)

<p>
        Protected method to determine the name of the database file.
</p>
<dl>
<dt>Return:</dt>
<dd>
name of the database file
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
str
</dd>
</dl>
<a NAME="DbAPIs.autoCompletionWordSeparators" ID="DbAPIs.autoCompletionWordSeparators"></a>
<h4>DbAPIs.autoCompletionWordSeparators</h4>
<b>autoCompletionWordSeparators</b>(<i></i>)

<p>
        Public method to get the word separator characters.
</p>
<dl>
<dt>Return:</dt>
<dd>
word separator characters
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIs.close" ID="DbAPIs.close"></a>
<h4>DbAPIs.close</h4>
<b>close</b>(<i></i>)

<p>
        Public method to close the database.
</p>
<a NAME="DbAPIs.editorSaved" ID="DbAPIs.editorSaved"></a>
<h4>DbAPIs.editorSaved</h4>
<b>editorSaved</b>(<i>filename</i>)

<p>
        Public slot to handle the editorSaved signal.
</p>
<dl>

<dt><i>filename</i> (str)</dt>
<dd>
name of the file that was saved
</dd>
</dl>
<a NAME="DbAPIs.getApiFiles" ID="DbAPIs.getApiFiles"></a>
<h4>DbAPIs.getApiFiles</h4>
<b>getApiFiles</b>(<i></i>)

<p>
        Public method to get a list of API files loaded into the database.
</p>
<dl>
<dt>Return:</dt>
<dd>
list of API filenames
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIs.getCalltips" ID="DbAPIs.getCalltips"></a>
<h4>DbAPIs.getCalltips</h4>
<b>getCalltips</b>(<i>acWord, commas, context=None, fullContext=None, showContext=True, followHierarchy=False</i>)

<p>
        Public method to determine the calltips.
</p>
<dl>

<dt><i>acWord</i> (str)</dt>
<dd>
function to get calltips for
</dd>
<dt><i>commas</i> (int)</dt>
<dd>
minimum number of commas contained in the calltip
</dd>
<dt><i>context</i> (str)</dt>
<dd>
string giving the context (e.g. classname)
</dd>
<dt><i>fullContext</i> (str)</dt>
<dd>
string giving the full context
</dd>
<dt><i>showContext</i> (bool)</dt>
<dd>
flag indicating to show the calltip context
</dd>
<dt><i>followHierarchy</i> (bool)</dt>
<dd>
flag indicating to follow the hierarchy of
            base classes
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of calltips
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIs.getCompletions" ID="DbAPIs.getCompletions"></a>
<h4>DbAPIs.getCompletions</h4>
<b>getCompletions</b>(<i>start=None, context=None, followHierarchy=False</i>)

<p>
        Public method to determine the possible completions.
</p>
<dl>

<dt><i>start</i> (str)</dt>
<dd>
string giving the start of the word to be
            completed
</dd>
<dt><i>context</i> (str)</dt>
<dd>
string giving the context (e.g. classname)
            to be completed
</dd>
<dt><i>followHierarchy</i> (bool)</dt>
<dd>
flag indicating to follow the hierarchy of
            base classes
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
list of dictionaries with possible completions
            (key 'completion' contains the completion,
            key 'context' contains the context and
            key 'pictureId' contains the ID of the icon to be shown)
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of dict
</dd>
</dl>
<a NAME="DbAPIs.getLexer" ID="DbAPIs.getLexer"></a>
<h4>DbAPIs.getLexer</h4>
<b>getLexer</b>(<i></i>)

<p>
        Public method to return a reference to our lexer object.
</p>
<dl>
<dt>Return:</dt>
<dd>
reference to the lexer object
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
Lexer
</dd>
</dl>
<a NAME="DbAPIs.prepareAPIs" ID="DbAPIs.prepareAPIs"></a>
<h4>DbAPIs.prepareAPIs</h4>
<b>prepareAPIs</b>(<i>rawList=None</i>)

<p>
        Public method to prepare the APIs if neccessary.
</p>
<dl>

<dt><i>rawList</i> (list of str)</dt>
<dd>
list of raw API files
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="DbAPIsWorker" ID="DbAPIsWorker"></a>
<h2>DbAPIsWorker</h2>

<p>
    Class implementing a worker thread to prepare the API database.
</p>
<h3>Signals</h3>
<dl>

<dt>processing(status, file)</dt>
<dd>
emitted to indicate the processing status
            (one of WorkerStatus..., string)
</dd>
</dl>
<h3>Derived from</h3>
QThread
<h3>Class Attributes</h3>

<table>
<tr><td>api_files_stmt</td></tr><tr><td>file_delete_id_stmt</td></tr><tr><td>file_id_stmt</td></tr><tr><td>file_loaded_stmt</td></tr><tr><td>populate_api_stmt</td></tr><tr><td>populate_bases_stmt</td></tr><tr><td>populate_del_api_stmt</td></tr><tr><td>populate_del_bases_stmt</td></tr><tr><td>populate_file_stmt</td></tr><tr><td>update_file_stmt</td></tr>
</table>
<h3>Class Methods</h3>

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

<table>

<tr>
<td><a href="#DbAPIsWorker.__init__">DbAPIsWorker</a></td>
<td>Constructor</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__autoCompletionWordSeparators">__autoCompletionWordSeparators</a></td>
<td>Private method to get the word separator characters for a language.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__classesAttributesApi">__classesAttributesApi</a></td>
<td>Private method to generate class api section for class attributes.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__deleteApiFile">__deleteApiFile</a></td>
<td>Private method to delete all references to an api file.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__getApiFiles">__getApiFiles</a></td>
<td>Private method to get a list of API files loaded into the database.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__loadApiFile">__loadApiFile</a></td>
<td>Private method to read a raw API file into the database.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__loadApiFileIfNewer">__loadApiFileIfNewer</a></td>
<td>Private method to load an API file, if it is newer than the one read into the database.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__storeApis">__storeApis</a></td>
<td>Private method to put the API entries into the database.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.__storeFileInfoOnly">__storeFileInfoOnly</a></td>
<td>Private method to store file info only.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.abort">abort</a></td>
<td>Public method to ask the thread to stop.</td>
</tr>
<tr>
<td><a href="#DbAPIsWorker.run">run</a></td>
<td>Public method to perform the threads work.</td>
</tr>
</table>
<h3>Static Methods</h3>

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

<a NAME="DbAPIsWorker.__init__" ID="DbAPIsWorker.__init__"></a>
<h4>DbAPIsWorker (Constructor)</h4>
<b>DbAPIsWorker</b>(<i>proxy, language, apiFiles, dbName, projectPath="", refresh=False, projectType=""</i>)

<p>
        Constructor
</p>
<dl>

<dt><i>proxy</i> (DbAPIs)</dt>
<dd>
reference to the object that is proxied
</dd>
<dt><i>language</i> (str)</dt>
<dd>
language of the APIs object
</dd>
<dt><i>apiFiles</i> (list of str)</dt>
<dd>
list of API files to process
</dd>
<dt><i>dbName</i> (str)</dt>
<dd>
path name of the database file
</dd>
<dt><i>projectPath</i> (str)</dt>
<dd>
path of the project. Only needed, if the APIs
            are extracted out of the sources of a project.
</dd>
<dt><i>refresh</i> (bool)</dt>
<dd>
flag indicating a refresh of the APIs of one file
</dd>
<dt><i>projectType</i> (str)</dt>
<dd>
type of the project
</dd>
</dl>
<a NAME="DbAPIsWorker.__autoCompletionWordSeparators" ID="DbAPIsWorker.__autoCompletionWordSeparators"></a>
<h4>DbAPIsWorker.__autoCompletionWordSeparators</h4>
<b>__autoCompletionWordSeparators</b>(<i>language</i>)

<p>
        Private method to get the word separator characters for a language.
</p>
<dl>

<dt><i>language</i> (str)</dt>
<dd>
language of the APIs object
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
word separator characters
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIsWorker.__classesAttributesApi" ID="DbAPIsWorker.__classesAttributesApi"></a>
<h4>DbAPIsWorker.__classesAttributesApi</h4>
<b>__classesAttributesApi</b>(<i>module</i>)

<p>
        Private method to generate class api section for class attributes.
</p>
<dl>

<dt><i>module</i> (Module)</dt>
<dd>
module object to get the info from
</dd>
</dl>
<dl>
<dt>Return:</dt>
<dd>
API information
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIsWorker.__deleteApiFile" ID="DbAPIsWorker.__deleteApiFile"></a>
<h4>DbAPIsWorker.__deleteApiFile</h4>
<b>__deleteApiFile</b>(<i>apiFile</i>)

<p>
        Private method to delete all references to an api file.
</p>
<dl>

<dt><i>apiFile</i> (str)</dt>
<dd>
filename of the raw API file
</dd>
</dl>
<a NAME="DbAPIsWorker.__getApiFiles" ID="DbAPIsWorker.__getApiFiles"></a>
<h4>DbAPIsWorker.__getApiFiles</h4>
<b>__getApiFiles</b>(<i></i>)

<p>
        Private method to get a list of API files loaded into the database.
</p>
<dl>
<dt>Return:</dt>
<dd>
list of API filenames
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<a NAME="DbAPIsWorker.__loadApiFile" ID="DbAPIsWorker.__loadApiFile"></a>
<h4>DbAPIsWorker.__loadApiFile</h4>
<b>__loadApiFile</b>(<i>apiFile</i>)

<p>
        Private method to read a raw API file into the database.
</p>
<dl>

<dt><i>apiFile</i> (str)</dt>
<dd>
filename of the raw API file
</dd>
</dl>
<a NAME="DbAPIsWorker.__loadApiFileIfNewer" ID="DbAPIsWorker.__loadApiFileIfNewer"></a>
<h4>DbAPIsWorker.__loadApiFileIfNewer</h4>
<b>__loadApiFileIfNewer</b>(<i>apiFile</i>)

<p>
        Private method to load an API file, if it is newer than the one read
        into the database.
</p>
<dl>

<dt><i>apiFile</i> (str)</dt>
<dd>
filename of the raw API file
</dd>
</dl>
<a NAME="DbAPIsWorker.__storeApis" ID="DbAPIsWorker.__storeApis"></a>
<h4>DbAPIsWorker.__storeApis</h4>
<b>__storeApis</b>(<i>apis, bases, apiFile, language</i>)

<p>
        Private method to put the API entries into the database.
</p>
<dl>

<dt><i>apis</i> (list of str)</dt>
<dd>
list of api entries
</dd>
<dt><i>bases</i> (list of str)</dt>
<dd>
list of base class entries
</dd>
<dt><i>apiFile</i> (str)</dt>
<dd>
filename of the file read to get the APIs
</dd>
<dt><i>language</i> (str)</dt>
<dd>
programming language of the file of the APIs
</dd>
</dl>
<a NAME="DbAPIsWorker.__storeFileInfoOnly" ID="DbAPIsWorker.__storeFileInfoOnly"></a>
<h4>DbAPIsWorker.__storeFileInfoOnly</h4>
<b>__storeFileInfoOnly</b>(<i>apiFile</i>)

<p>
        Private method to store file info only.
</p>
<p>
        Doing this avoids rereading the file whenever the API is initialized
        in case the given file doesn't contain API data.
</p>
<dl>

<dt><i>apiFile</i> (str)</dt>
<dd>
file name of the API file
</dd>
</dl>
<a NAME="DbAPIsWorker.abort" ID="DbAPIsWorker.abort"></a>
<h4>DbAPIsWorker.abort</h4>
<b>abort</b>(<i></i>)

<p>
        Public method to ask the thread to stop.
</p>
<a NAME="DbAPIsWorker.run" ID="DbAPIsWorker.run"></a>
<h4>DbAPIsWorker.run</h4>
<b>run</b>(<i></i>)

<p>
        Public method to perform the threads work.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial