eric7/Documentation/Source/eric7.QScintilla.DocstringGenerator.BaseDocstringGenerator.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Documentation/Source/eric7.QScintilla.DocstringGenerator.BaseDocstringGenerator.html	Mon May 24 11:19:57 2021 +0200
@@ -0,0 +1,454 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric7.QScintilla.DocstringGenerator.BaseDocstringGenerator</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>eric7.QScintilla.DocstringGenerator.BaseDocstringGenerator</h1>
+
+<p>
+Module implementing a docstring generator base class.
+</p>
+<h3>Global Attributes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+
+<table>
+
+<tr>
+<td><a href="#BaseDocstringGenerator">BaseDocstringGenerator</a></td>
+<td>Class implementing a docstring generator base class.</td>
+</tr>
+<tr>
+<td><a href="#DocstringMenuForEnterOnly">DocstringMenuForEnterOnly</a></td>
+<td>Class implementing a special menu reacting to the enter/return keys only.</td>
+</tr>
+<tr>
+<td><a href="#FunctionInfo">FunctionInfo</a></td>
+<td>Class implementing an object to store function information.</td>
+</tr>
+</table>
+<h3>Functions</h3>
+
+<table>
+
+<tr>
+<td><a href="#getIndentStr">getIndentStr</a></td>
+<td>Function to get the indentation of a text.</td>
+</tr>
+</table>
+<hr />
+<hr />
+<a NAME="BaseDocstringGenerator" ID="BaseDocstringGenerator"></a>
+<h2>BaseDocstringGenerator</h2>
+
+<p>
+    Class implementing a docstring generator base class.
+</p>
+<h3>Derived from</h3>
+None
+<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="#BaseDocstringGenerator.__init__">BaseDocstringGenerator</a></td>
+<td>Constructor</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator._generateDocstringList">_generateDocstringList</a></td>
+<td>Protected method to generate type specific docstrings based on the extracted function information.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.getDocstringType">getDocstringType</a></td>
+<td>Public method to determine the docstring type to be generated.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.hasFunctionDefinition">hasFunctionDefinition</a></td>
+<td>Public method to test, if the cursor is right below a function definition.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.insertDocstring">insertDocstring</a></td>
+<td>Public method to insert a docstring for the function at the cursor position.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.insertDocstringFromShortcut">insertDocstringFromShortcut</a></td>
+<td>Public method to insert a docstring for the function at the cursor position initiated via a keyboard shortcut.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.isDocstringIntro">isDocstringIntro</a></td>
+<td>Public function to test, if the line up to the cursor position might be introducing a docstring.</td>
+</tr>
+<tr>
+<td><a href="#BaseDocstringGenerator.isFunctionStart">isFunctionStart</a></td>
+<td>Public method to test, if a text is the start of a function or method definition.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<a NAME="BaseDocstringGenerator.__init__" ID="BaseDocstringGenerator.__init__"></a>
+<h4>BaseDocstringGenerator (Constructor)</h4>
+<b>BaseDocstringGenerator</b>(<i>editor</i>)
+
+<p>
+        Constructor
+</p>
+<dl>
+
+<dt><i>editor</i> (Editor)</dt>
+<dd>
+reference to the editor widget
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator._generateDocstringList" ID="BaseDocstringGenerator._generateDocstringList"></a>
+<h4>BaseDocstringGenerator._generateDocstringList</h4>
+<b>_generateDocstringList</b>(<i>functionInfo, docstringType</i>)
+
+<p>
+        Protected method to generate type specific docstrings based on the
+        extracted function information.
+</p>
+<dl>
+
+<dt><i>functionInfo</i> (FunctionInfo)</dt>
+<dd>
+reference to the function info object
+</dd>
+<dt><i>docstringType</i></dt>
+<dd>
+kind of docstring to be generated
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+list of docstring lines
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.getDocstringType" ID="BaseDocstringGenerator.getDocstringType"></a>
+<h4>BaseDocstringGenerator.getDocstringType</h4>
+<b>getDocstringType</b>(<i></i>)
+
+<p>
+        Public method to determine the docstring type to be generated.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+docstring type (one of 'ericdoc', 'numpydoc', 'googledoc',
+            'sphinxdoc')
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.hasFunctionDefinition" ID="BaseDocstringGenerator.hasFunctionDefinition"></a>
+<h4>BaseDocstringGenerator.hasFunctionDefinition</h4>
+<b>hasFunctionDefinition</b>(<i>cursorPosition</i>)
+
+<p>
+        Public method to test, if the cursor is right below a function
+        definition.
+</p>
+<dl>
+
+<dt><i>cursorPosition</i> (tuple of (int, int))</dt>
+<dd>
+current cursor position (line and column)
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating cursor is right below a function definition
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.insertDocstring" ID="BaseDocstringGenerator.insertDocstring"></a>
+<h4>BaseDocstringGenerator.insertDocstring</h4>
+<b>insertDocstring</b>(<i>cursorPosition, fromStart=True</i>)
+
+<p>
+        Public method to insert a docstring for the function at the cursor
+        position.
+</p>
+<dl>
+
+<dt><i>cursorPosition</i> (tuple of (int, int))</dt>
+<dd>
+position of the cursor (line and index)
+</dd>
+<dt><i>fromStart</i> (bool)</dt>
+<dd>
+flag indicating that the editor text cursor is placed
+            on the line starting the function definition
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.insertDocstringFromShortcut" ID="BaseDocstringGenerator.insertDocstringFromShortcut"></a>
+<h4>BaseDocstringGenerator.insertDocstringFromShortcut</h4>
+<b>insertDocstringFromShortcut</b>(<i>cursorPosition</i>)
+
+<p>
+        Public method to insert a docstring for the function at the cursor
+        position initiated via a keyboard shortcut.
+</p>
+<dl>
+
+<dt><i>cursorPosition</i> (tuple of (int, int))</dt>
+<dd>
+position of the cursor (line and index)
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.isDocstringIntro" ID="BaseDocstringGenerator.isDocstringIntro"></a>
+<h4>BaseDocstringGenerator.isDocstringIntro</h4>
+<b>isDocstringIntro</b>(<i>cursorPosition</i>)
+
+<p>
+        Public function to test, if the line up to the cursor position might be
+        introducing a docstring.
+</p>
+<dl>
+
+<dt><i>cursorPosition</i> (tuple of (int, int))</dt>
+<dd>
+current cursor position (line and column)
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating a potential start of a docstring
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<a NAME="BaseDocstringGenerator.isFunctionStart" ID="BaseDocstringGenerator.isFunctionStart"></a>
+<h4>BaseDocstringGenerator.isFunctionStart</h4>
+<b>isFunctionStart</b>(<i>text</i>)
+
+<p>
+        Public method to test, if a text is the start of a function or method
+        definition.
+</p>
+<dl>
+
+<dt><i>text</i> (str)</dt>
+<dd>
+line of text to be tested
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating that the given text starts a function or
+            method definition (always False)
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
+<a NAME="DocstringMenuForEnterOnly" ID="DocstringMenuForEnterOnly"></a>
+<h2>DocstringMenuForEnterOnly</h2>
+
+<p>
+    Class implementing a special menu reacting to the enter/return keys only.
+</p>
+<p>
+    If a keyboard input is not the "enter key", the menu is closed and the
+    input is inserted to the code editor.
+</p>
+<h3>Derived from</h3>
+QMenu
+<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="#DocstringMenuForEnterOnly.__init__">DocstringMenuForEnterOnly</a></td>
+<td>Constructor</td>
+</tr>
+<tr>
+<td><a href="#DocstringMenuForEnterOnly.keyPressEvent">keyPressEvent</a></td>
+<td>Protected method to handle key press events.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<a NAME="DocstringMenuForEnterOnly.__init__" ID="DocstringMenuForEnterOnly.__init__"></a>
+<h4>DocstringMenuForEnterOnly (Constructor)</h4>
+<b>DocstringMenuForEnterOnly</b>(<i>editor</i>)
+
+<p>
+        Constructor
+</p>
+<dl>
+
+<dt><i>editor</i> (Editor)</dt>
+<dd>
+reference to the editor
+</dd>
+</dl>
+<a NAME="DocstringMenuForEnterOnly.keyPressEvent" ID="DocstringMenuForEnterOnly.keyPressEvent"></a>
+<h4>DocstringMenuForEnterOnly.keyPressEvent</h4>
+<b>keyPressEvent</b>(<i>evt</i>)
+
+<p>
+        Protected method to handle key press events.
+</p>
+<dl>
+
+<dt><i>evt</i> (QKeyEvent)</dt>
+<dd>
+reference to the key press event object
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
+<a NAME="FunctionInfo" ID="FunctionInfo"></a>
+<h2>FunctionInfo</h2>
+
+<p>
+    Class implementing an object to store function information.
+</p>
+<p>
+    Methods to extract the relevant information need to be implemented in
+    language specific subclasses.
+</p>
+<h3>Derived from</h3>
+None
+<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="#FunctionInfo.__init__">FunctionInfo</a></td>
+<td>Constructor</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<a NAME="FunctionInfo.__init__" ID="FunctionInfo.__init__"></a>
+<h4>FunctionInfo (Constructor)</h4>
+<b>FunctionInfo</b>(<i></i>)
+
+<p>
+        Constructor
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
+<a NAME="getIndentStr" ID="getIndentStr"></a>
+<h2>getIndentStr</h2>
+<b>getIndentStr</b>(<i>text</i>)
+
+<p>
+    Function to get the indentation of a text.
+</p>
+<dl>
+
+<dt><i>text</i> (str)</dt>
+<dd>
+text to extract indentation from
+</dd>
+</dl>
+<dl>
+<dt>Return:</dt>
+<dd>
+indentation string
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+str
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file

eric ide

mercurial