eric6/Documentation/Source/eric6.QScintilla.Lexers.__init__.html

Sat, 19 Dec 2020 15:22:26 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Dec 2020 15:22:26 +0100
changeset 7900
72b88fb20261
parent 7273
391d6b7b1eff
child 7989
a21d673a8f99
permissions
-rw-r--r--

Corrected the use of '@keyparam' in the source documentation.

<!DOCTYPE html>
<html><head>
<title>eric6.QScintilla.Lexers.__init__</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>eric6.QScintilla.Lexers.__init__</h1>

<p>
Package implementing lexers for the various supported programming languages.
</p>
<h3>Global Attributes</h3>

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

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

<table>

<tr>
<td><a href="#__getPygmentsLexer">__getPygmentsLexer</a></td>
<td>Private module function to instantiate a pygments lexer.</td>
</tr>
<tr>
<td><a href="#getDefaultLexerAssociations">getDefaultLexerAssociations</a></td>
<td>Module function to get a dictionary with the default associations.</td>
</tr>
<tr>
<td><a href="#getLanguageIcon">getLanguageIcon</a></td>
<td>Module function to get an icon for a language.</td>
</tr>
<tr>
<td><a href="#getLexer">getLexer</a></td>
<td>Module function to instantiate a lexer object for a given language.</td>
</tr>
<tr>
<td><a href="#getOpenFileFiltersList">getOpenFileFiltersList</a></td>
<td>Module function to get the file filter list for an open file operation.</td>
</tr>
<tr>
<td><a href="#getSaveFileFiltersList">getSaveFileFiltersList</a></td>
<td>Module function to get the file filter list for a save file operation.</td>
</tr>
<tr>
<td><a href="#getSupportedApiLanguages">getSupportedApiLanguages</a></td>
<td>Module function to get a list of supported API languages.</td>
</tr>
<tr>
<td><a href="#getSupportedLanguages">getSupportedLanguages</a></td>
<td>Module function to get a dictionary of supported lexer languages.</td>
</tr>
<tr>
<td><a href="#registerLexer">registerLexer</a></td>
<td>Module function to register a custom QScintilla lexer.</td>
</tr>
<tr>
<td><a href="#unregisterLexer">unregisterLexer</a></td>
<td>Module function to unregister a custom QScintilla lexer.</td>
</tr>
</table>
<hr />
<hr />
<a NAME="__getPygmentsLexer" ID="__getPygmentsLexer"></a>
<h2>__getPygmentsLexer</h2>
<b>__getPygmentsLexer</b>(<i>parent, name=""</i>)

<p>
    Private module function to instantiate a pygments lexer.
</p>
<dl>

<dt><i>parent</i></dt>
<dd>
reference to the parent widget
</dd>
<dt><i>name</i></dt>
<dd>
name of the pygments lexer to use (string)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>
reference to the lexer (LexerPygments) or None
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getDefaultLexerAssociations" ID="getDefaultLexerAssociations"></a>
<h2>getDefaultLexerAssociations</h2>
<b>getDefaultLexerAssociations</b>(<i></i>)

<p>
    Module function to get a dictionary with the default associations.
</p>
<dl>
<dt>Returns:</dt>
<dd>
dictionary with the default lexer associations
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getLanguageIcon" ID="getLanguageIcon"></a>
<h2>getLanguageIcon</h2>
<b>getLanguageIcon</b>(<i>language, pixmap</i>)

<p>
    Module function to get an icon for a language.
</p>
<dl>

<dt><i>language</i></dt>
<dd>
language of the lexer (string)
</dd>
<dt><i>pixmap</i></dt>
<dd>
flag indicating to return a pixmap (boolean)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>
icon for the language (QPixmap or QIcon)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getLexer" ID="getLexer"></a>
<h2>getLexer</h2>
<b>getLexer</b>(<i>language, parent=None, pyname=""</i>)

<p>
    Module function to instantiate a lexer object for a given language.
</p>
<dl>

<dt><i>language</i></dt>
<dd>
language of the lexer (string)
</dd>
<dt><i>parent</i></dt>
<dd>
reference to the parent object (QObject)
</dd>
<dt><i>pyname</i></dt>
<dd>
name of the pygments lexer to use (string)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>
reference to the instanciated lexer object (QsciLexer)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getOpenFileFiltersList" ID="getOpenFileFiltersList"></a>
<h2>getOpenFileFiltersList</h2>
<b>getOpenFileFiltersList</b>(<i>includeAll=False, asString=False, withAdditional=True</i>)

<p>
    Module function to get the file filter list for an open file operation.
</p>
<dl>

<dt><i>includeAll</i></dt>
<dd>
flag indicating the inclusion of the
        All Files filter (boolean)
</dd>
<dt><i>asString</i></dt>
<dd>
flag indicating the list should be returned
        as a string (boolean)
</dd>
<dt><i>withAdditional</i></dt>
<dd>
flag indicating to include additional filters
        defined by the user (boolean)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>
file filter list (list of strings or string)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getSaveFileFiltersList" ID="getSaveFileFiltersList"></a>
<h2>getSaveFileFiltersList</h2>
<b>getSaveFileFiltersList</b>(<i>includeAll=False, asString=False, withAdditional=True</i>)

<p>
    Module function to get the file filter list for a save file operation.
</p>
<dl>

<dt><i>includeAll</i></dt>
<dd>
flag indicating the inclusion of the
        All Files filter (boolean)
</dd>
<dt><i>asString</i></dt>
<dd>
flag indicating the list should be returned
        as a string (boolean)
</dd>
<dt><i>withAdditional</i></dt>
<dd>
flag indicating to include additional filters
        defined by the user (boolean)
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd>
file filter list (list of strings or string)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getSupportedApiLanguages" ID="getSupportedApiLanguages"></a>
<h2>getSupportedApiLanguages</h2>
<b>getSupportedApiLanguages</b>(<i></i>)

<p>
    Module function to get a list of supported API languages.
</p>
<dl>
<dt>Returns:</dt>
<dd>
list of supported API languages
</dd>
</dl>
<dl>
<dt>Return Type:</dt>
<dd>
list of str
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="getSupportedLanguages" ID="getSupportedLanguages"></a>
<h2>getSupportedLanguages</h2>
<b>getSupportedLanguages</b>(<i></i>)

<p>
    Module function to get a dictionary of supported lexer languages.
</p>
<dl>
<dt>Returns:</dt>
<dd>
dictionary of supported lexer languages. The keys are the
        internal language names. The items are lists of three entries.
        The first is the display string for the language, the second
        is a dummy file name, which can be used to derive the lexer, and
        the third is the name of an icon file.
        (string, string, string)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="registerLexer" ID="registerLexer"></a>
<h2>registerLexer</h2>
<b>registerLexer</b>(<i>name, displayString, filenameSample, getLexerFunc, openFilters=None, saveFilters=None, defaultAssocs=None, iconFileName=""</i>)

<p>
    Module function to register a custom QScintilla lexer.
</p>
<dl>

<dt><i>name</i></dt>
<dd>
lexer language name (string)
</dd>
<dt><i>displayString</i></dt>
<dd>
display string (string)
</dd>
<dt><i>filenameSample</i></dt>
<dd>
dummy filename to derive lexer name (string)
</dd>
<dt><i>getLexerFunc</i></dt>
<dd>
reference to a function instantiating the specific
        lexer. This function must take a reference to the parent as its only
        argument.
</dd>
<dt><i>openFilters</i></dt>
<dd>
list of open file filters (list of strings)
</dd>
<dt><i>saveFilters</i></dt>
<dd>
list of save file filters (list of strings)
</dd>
<dt><i>defaultAssocs</i></dt>
<dd>
default lexer associations (list of strings of
        filename wildcard patterns to be associated with the lexer)
</dd>
<dt><i>iconFileName</i></dt>
<dd>
name of an icon file (string)
</dd>
</dl>
<dl>

<dt>Raises <b>KeyError</b>:</dt>
<dd>
raised when the given name is already in use
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
<hr />
<a NAME="unregisterLexer" ID="unregisterLexer"></a>
<h2>unregisterLexer</h2>
<b>unregisterLexer</b>(<i>name</i>)

<p>
    Module function to unregister a custom QScintilla lexer.
</p>
<dl>

<dt><i>name</i></dt>
<dd>
lexer language name (string)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial