Mon, 12 Dec 2022 16:43:08 +0100
Moved the IDL class browser to this plugin.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/Documentation/source/Plugin_Extension_Corba.ExtensionCorba.LexerIDL.html Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,184 @@ +<!DOCTYPE html> +<html><head> +<title>Plugin_Extension_Corba.ExtensionCorba.LexerIDL</title> +<meta charset="UTF-8"> +<link rel="stylesheet" href="styles.css"> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>Plugin_Extension_Corba.ExtensionCorba.LexerIDL</h1> + +<p> +Module implementing an IDL lexer with some additional methods. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> + +<table> + +<tr> +<td><a href="#LexerIDL">LexerIDL</a></td> +<td>Subclass to implement some additional lexer dependant methods.</td> +</tr> +</table> +<h3>Functions</h3> + +<table> +<tr><td>None</td></tr> +</table> +<hr /> +<hr /> +<a NAME="LexerIDL" ID="LexerIDL"></a> +<h2>LexerIDL</h2> + +<p> + Subclass to implement some additional lexer dependant methods. +</p> +<h3>Derived from</h3> +Lexer, QsciLexerIDL +<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="#LexerIDL.__init__">LexerIDL</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#LexerIDL.defaultKeywords">defaultKeywords</a></td> +<td>Public method to get the default keywords.</td> +</tr> +<tr> +<td><a href="#LexerIDL.initProperties">initProperties</a></td> +<td>Public slot to initialize the properties.</td> +</tr> +<tr> +<td><a href="#LexerIDL.isCommentStyle">isCommentStyle</a></td> +<td>Public method to check, if a style is a comment style.</td> +</tr> +<tr> +<td><a href="#LexerIDL.isStringStyle">isStringStyle</a></td> +<td>Public method to check, if a style is a string style.</td> +</tr> +<tr> +<td><a href="#LexerIDL.maximumKeywordSet">maximumKeywordSet</a></td> +<td>Public method to get the maximum keyword set.</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="LexerIDL.__init__" ID="LexerIDL.__init__"></a> +<h4>LexerIDL (Constructor)</h4> +<b>LexerIDL</b>(<i>parent=None</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>parent</i></dt> +<dd> +parent widget of this lexer +</dd> +</dl> +<a NAME="LexerIDL.defaultKeywords" ID="LexerIDL.defaultKeywords"></a> +<h4>LexerIDL.defaultKeywords</h4> +<b>defaultKeywords</b>(<i>kwSet</i>) + +<p> + Public method to get the default keywords. +</p> +<dl> + +<dt><i>kwSet</i></dt> +<dd> +number of the keyword set (integer) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +string giving the keywords (string) or None +</dd> +</dl> +<a NAME="LexerIDL.initProperties" ID="LexerIDL.initProperties"></a> +<h4>LexerIDL.initProperties</h4> +<b>initProperties</b>(<i></i>) + +<p> + Public slot to initialize the properties. +</p> +<a NAME="LexerIDL.isCommentStyle" ID="LexerIDL.isCommentStyle"></a> +<h4>LexerIDL.isCommentStyle</h4> +<b>isCommentStyle</b>(<i>style</i>) + +<p> + Public method to check, if a style is a comment style. +</p> +<dl> + +<dt><i>style</i></dt> +<dd> +style to check (integer) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating a comment style (boolean) +</dd> +</dl> +<a NAME="LexerIDL.isStringStyle" ID="LexerIDL.isStringStyle"></a> +<h4>LexerIDL.isStringStyle</h4> +<b>isStringStyle</b>(<i>style</i>) + +<p> + Public method to check, if a style is a string style. +</p> +<dl> + +<dt><i>style</i></dt> +<dd> +style to check (integer) +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +flag indicating a string style (boolean) +</dd> +</dl> +<a NAME="LexerIDL.maximumKeywordSet" ID="LexerIDL.maximumKeywordSet"></a> +<h4>LexerIDL.maximumKeywordSet</h4> +<b>maximumKeywordSet</b>(<i></i>) + +<p> + Public method to get the maximum keyword set. +</p> +<dl> +<dt>Return:</dt> +<dd> +maximum keyword set (integer) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/Documentation/source/Plugin_Extension_Corba.ExtensionCorba.idlclbr.html Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,516 @@ +<!DOCTYPE html> +<html><head> +<title>Plugin_Extension_Corba.ExtensionCorba.idlclbr</title> +<meta charset="UTF-8"> +<link rel="stylesheet" href="styles.css"> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>Plugin_Extension_Corba.ExtensionCorba.idlclbr</h1> + +<p> +Parse a CORBA IDL file and retrieve modules, interfaces, methods and +attributes. +</p> +<p> +Parse enough of a CORBA IDL file to recognize module, interface and method +definitions and to find out the superclasses of an interface as well as its +attributes. +</p> +<p> +It is based on the Python class browser found in this package. +</p> +<h3>Global Attributes</h3> + +<table> +<tr><td>_commentsub</td></tr><tr><td>_getnext</td></tr><tr><td>_normalize</td></tr> +</table> +<h3>Classes</h3> + +<table> + +<tr> +<td><a href="#Attribute">Attribute</a></td> +<td>Class to represent a CORBA IDL attribute.</td> +</tr> +<tr> +<td><a href="#Function">Function</a></td> +<td>Class to represent a CORBA IDL function.</td> +</tr> +<tr> +<td><a href="#Interface">Interface</a></td> +<td>Class to represent a CORBA IDL interface.</td> +</tr> +<tr> +<td><a href="#Module">Module</a></td> +<td>Class to represent a CORBA IDL module.</td> +</tr> +<tr> +<td><a href="#VisibilityMixin">VisibilityMixin</a></td> +<td>Mixin class implementing the notion of visibility.</td> +</tr> +</table> +<h3>Functions</h3> + +<table> + +<tr> +<td><a href="#calculateEndline">calculateEndline</a></td> +<td>Function to calculate the end line.</td> +</tr> +<tr> +<td><a href="#calculateMethodEndline">calculateMethodEndline</a></td> +<td>Function to calculate the end line.</td> +</tr> +<tr> +<td><a href="#readmodule_ex">readmodule_ex</a></td> +<td>Read a CORBA IDL file and return a dictionary of classes, functions and modules.</td> +</tr> +<tr> +<td><a href="#scan">scan</a></td> +<td>Public method to scan the given source text.</td> +</tr> +</table> +<hr /> +<hr /> +<a NAME="Attribute" ID="Attribute"></a> +<h2>Attribute</h2> + +<p> + Class to represent a CORBA IDL attribute. +</p> +<h3>Derived from</h3> +ClbrBaseClasses.Attribute, VisibilityMixin +<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="#Attribute.__init__">Attribute</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="Attribute.__init__" ID="Attribute.__init__"></a> +<h4>Attribute (Constructor)</h4> +<b>Attribute</b>(<i>module, name, file, lineno</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>module</i> (str)</dt> +<dd> +name of the module containing this attribute +</dd> +<dt><i>name</i> (str)</dt> +<dd> +name of this attribute +</dd> +<dt><i>file</i> (str)</dt> +<dd> +filename containing this attribute +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number of the attribute definition +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="Function" ID="Function"></a> +<h2>Function</h2> + +<p> + Class to represent a CORBA IDL function. +</p> +<h3>Derived from</h3> +ClbrBaseClasses.Function, VisibilityMixin +<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="#Function.__init__">Function</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="Function.__init__" ID="Function.__init__"></a> +<h4>Function (Constructor)</h4> +<b>Function</b>(<i>module, name, file, lineno, signature="", separator=", "</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>module</i> (str)</dt> +<dd> +name of the module containing this function +</dd> +<dt><i>name</i> (str)</dt> +<dd> +name of this function +</dd> +<dt><i>file</i> (str)</dt> +<dd> +filename containing this function +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number of the function definition +</dd> +<dt><i>signature</i> (str)</dt> +<dd> +parameter list of the function +</dd> +<dt><i>separator</i> (str)</dt> +<dd> +string separating the parameters +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="Interface" ID="Interface"></a> +<h2>Interface</h2> + +<p> + Class to represent a CORBA IDL interface. +</p> +<h3>Derived from</h3> +ClbrBaseClasses.Class, VisibilityMixin +<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="#Interface.__init__">Interface</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="Interface.__init__" ID="Interface.__init__"></a> +<h4>Interface (Constructor)</h4> +<b>Interface</b>(<i>module, name, superClasses, file, lineno</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>module</i> (str)</dt> +<dd> +name of the module containing this interface +</dd> +<dt><i>name</i> (str)</dt> +<dd> +name of this interface +</dd> +<dt><i>superClasses</i> (list of str)</dt> +<dd> +list of interface names this interface is + inherited from +</dd> +<dt><i>file</i> (str)</dt> +<dd> +filename containing this interface +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number of the interface definition +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="Module" ID="Module"></a> +<h2>Module</h2> + +<p> + Class to represent a CORBA IDL module. +</p> +<h3>Derived from</h3> +ClbrBaseClasses.Module, VisibilityMixin +<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="#Module.__init__">Module</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="Module.__init__" ID="Module.__init__"></a> +<h4>Module (Constructor)</h4> +<b>Module</b>(<i>module, name, file, lineno</i>) + +<p> + Constructor +</p> +<dl> + +<dt><i>module</i> (str)</dt> +<dd> +name of the module containing this module +</dd> +<dt><i>name</i> (str)</dt> +<dd> +name of this module +</dd> +<dt><i>file</i> (str)</dt> +<dd> +filename containing this module +</dd> +<dt><i>lineno</i> (int)</dt> +<dd> +line number of the module definition +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="VisibilityMixin" ID="VisibilityMixin"></a> +<h2>VisibilityMixin</h2> + +<p> + Mixin class implementing the notion of visibility. +</p> +<h3>Derived from</h3> +ClbrBaseClasses.ClbrVisibilityMixinBase +<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="#VisibilityMixin.__init__">VisibilityMixin</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> + +<table> +<tr><td>None</td></tr> +</table> + +<a NAME="VisibilityMixin.__init__" ID="VisibilityMixin.__init__"></a> +<h4>VisibilityMixin (Constructor)</h4> +<b>VisibilityMixin</b>(<i></i>) + +<p> + Constructor +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="calculateEndline" ID="calculateEndline"></a> +<h2>calculateEndline</h2> +<b>calculateEndline</b>(<i>lineno, lines</i>) + +<p> + Function to calculate the end line. +</p> +<dl> + +<dt><i>lineno</i> (int)</dt> +<dd> +line number to start at (one based) +</dd> +<dt><i>lines</i> (list of str)</dt> +<dd> +list of source lines +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +end line (one based) +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +int +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="calculateMethodEndline" ID="calculateMethodEndline"></a> +<h2>calculateMethodEndline</h2> +<b>calculateMethodEndline</b>(<i>lineno, lines</i>) + +<p> + Function to calculate the end line. +</p> +<dl> + +<dt><i>lineno</i> (int)</dt> +<dd> +line number to start at (one based) +</dd> +<dt><i>lines</i> (list of str)</dt> +<dd> +list of source lines +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +end line (one based) +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +int +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="readmodule_ex" ID="readmodule_ex"></a> +<h2>readmodule_ex</h2> +<b>readmodule_ex</b>(<i>module, path=None</i>) + +<p> + Read a CORBA IDL file and return a dictionary of classes, functions and + modules. +</p> +<dl> + +<dt><i>module</i> (str)</dt> +<dd> +name of the IDL file +</dd> +<dt><i>path</i> (list of str)</dt> +<dd> +path the file should be searched in +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the resulting dictionary +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +dict +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="scan" ID="scan"></a> +<h2>scan</h2> +<b>scan</b>(<i>src, file, module</i>) + +<p> + Public method to scan the given source text. +</p> +<dl> + +<dt><i>src</i> (str)</dt> +<dd> +source text to be scanned +</dd> +<dt><i>file</i> (str)</dt> +<dd> +file name associated with the source text +</dd> +<dt><i>module</i> (str)</dt> +<dd> +module name associated with the source text +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +dictionary containing the extracted data +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +dict +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/ExtensionCorba/Documentation/source/Plugin_Extension_Corba.PluginExtensionCorba.html Sun Dec 11 11:17:15 2022 +0100 +++ b/ExtensionCorba/Documentation/source/Plugin_Extension_Corba.PluginExtensionCorba.html Mon Dec 12 16:43:08 2022 +0100 @@ -9,7 +9,7 @@ <h1>Plugin_Extension_Corba.PluginExtensionCorba</h1> <p> -Module documentation goes here. +Module implementing a plugin to add support for CORBA development. </p> <h3>Global Attributes</h3> @@ -22,7 +22,7 @@ <tr> <td><a href="#CorbaExtensionPlugin">CorbaExtensionPlugin</a></td> -<td>Class documentation goes here.</td> +<td>Class implementing a plugin to add support for CORBA development.</td> </tr> </table> <h3>Functions</h3> @@ -52,7 +52,7 @@ <h2>CorbaExtensionPlugin</h2> <p> - Class documentation goes here. + Class implementing a plugin to add support for CORBA development. </p> <h3>Derived from</h3> QObject @@ -91,6 +91,14 @@ <td>Public method to deactivate this plug-in.</td> </tr> <tr> +<td><a href="#CorbaExtensionPlugin.getFileIcon">getFileIcon</a></td> +<td>Public method to get the name of a file icon.</td> +</tr> +<tr> +<td><a href="#CorbaExtensionPlugin.getLexer">getLexer</a></td> +<td>Public method to instantiate a QScintilla CORBA IDL lexer object.</td> +</tr> +<tr> <td><a href="#CorbaExtensionPlugin.getPreferences">getPreferences</a></td> <td>Public method to retrieve the various settings values.</td> </tr> @@ -159,6 +167,58 @@ <p> Public method to deactivate this plug-in. </p> +<a NAME="CorbaExtensionPlugin.getFileIcon" ID="CorbaExtensionPlugin.getFileIcon"></a> +<h4>CorbaExtensionPlugin.getFileIcon</h4> +<b>getFileIcon</b>(<i>filename=""</i>) + +<p> + Public method to get the name of a file icon. +</p> +<dl> + +<dt><i>filename</i> (str (optional))</dt> +<dd> +file name (defaults to "") +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +name of a file icon +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<a NAME="CorbaExtensionPlugin.getLexer" ID="CorbaExtensionPlugin.getLexer"></a> +<h4>CorbaExtensionPlugin.getLexer</h4> +<b>getLexer</b>(<i>parent=None</i>) + +<p> + Public method to instantiate a QScintilla CORBA IDL lexer object. +</p> +<dl> + +<dt><i>parent</i> (QObject)</dt> +<dd> +reference to the parent object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the instanciated lexer object +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +QsciLexer +</dd> +</dl> <a NAME="CorbaExtensionPlugin.getPreferences" ID="CorbaExtensionPlugin.getPreferences"></a> <h4>CorbaExtensionPlugin.getPreferences</h4> <b>getPreferences</b>(<i>key</i>)
--- a/ExtensionCorba/Documentation/source/index-Plugin_Extension_Corba.ExtensionCorba.html Sun Dec 11 11:17:15 2022 +0100 +++ b/ExtensionCorba/Documentation/source/index-Plugin_Extension_Corba.ExtensionCorba.html Mon Dec 12 16:43:08 2022 +0100 @@ -32,8 +32,16 @@ <td>Module implementing a dialog to enter some IDL compiler options.</td> </tr> <tr> +<td><a href="Plugin_Extension_Corba.ExtensionCorba.LexerIDL.html">LexerIDL</a></td> +<td>Module implementing an IDL lexer with some additional methods.</td> +</tr> +<tr> <td><a href="Plugin_Extension_Corba.ExtensionCorba.ProjectInterfacesBrowser.html">ProjectInterfacesBrowser</a></td> <td>Module implementing the a class used to display the interfaces (IDL) part of the project.</td> </tr> +<tr> +<td><a href="Plugin_Extension_Corba.ExtensionCorba.idlclbr.html">idlclbr</a></td> +<td>Parse a CORBA IDL file and retrieve modules, interfaces, methods and attributes.</td> +</tr> </table> </body></html> \ No newline at end of file
--- a/ExtensionCorba/Documentation/source/index-Plugin_Extension_Corba.html Sun Dec 11 11:17:15 2022 +0100 +++ b/ExtensionCorba/Documentation/source/index-Plugin_Extension_Corba.html Mon Dec 12 16:43:08 2022 +0100 @@ -25,7 +25,7 @@ <tr> <td><a href="Plugin_Extension_Corba.PluginExtensionCorba.html">PluginExtensionCorba</a></td> -<td>Module documentation goes here.</td> +<td>Module implementing a plugin to add support for CORBA development.</td> </tr> </table> </body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/LexerIDL.py Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2002 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing an IDL lexer with some additional methods. +""" + +from PyQt6.Qsci import QsciLexerIDL, QsciScintilla + +from eric7 import Preferences +from eric7.QScintilla.Lexers.Lexer import Lexer + + +class LexerIDL(Lexer, QsciLexerIDL): + """ + Subclass to implement some additional lexer dependant methods. + """ + + def __init__(self, parent=None): + """ + Constructor + + @param parent parent widget of this lexer + """ + QsciLexerIDL.__init__(self, parent) + Lexer.__init__(self) + + self.commentString = "//" + self.streamCommentString = {"start": "/* ", "end": " */"} + self.boxCommentString = {"start": "/* ", "middle": " * ", "end": " */"} + + self.keywordSetDescriptions = [ + self.tr("Primary keywords and identifiers"), + self.tr("Secondary keywords and identifiers"), + self.tr("Documentation comment keywords"), + self.tr("Global classes and typedefs"), + self.tr("Preprocessor definitions"), + self.tr("Task marker and error marker keywords"), + ] + + def initProperties(self): + """ + Public slot to initialize the properties. + """ + self.setFoldComments(Preferences.getEditor("CppFoldComment")) + self.setFoldPreprocessor(Preferences.getEditor("CppFoldPreprocessor")) + self.setFoldAtElse(Preferences.getEditor("CppFoldAtElse")) + indentStyle = 0 + if Preferences.getEditor("CppIndentOpeningBrace"): + indentStyle |= QsciScintilla.AiOpening + if Preferences.getEditor("CppIndentClosingBrace"): + indentStyle |= QsciScintilla.AiClosing + self.setAutoIndentStyle(indentStyle) + self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) + + def isCommentStyle(self, style): + """ + Public method to check, if a style is a comment style. + + @param style style to check (integer) + @return flag indicating a comment style (boolean) + """ + return style in [ + QsciLexerIDL.Comment, + QsciLexerIDL.CommentDoc, + QsciLexerIDL.CommentLine, + QsciLexerIDL.CommentLineDoc, + ] + + def isStringStyle(self, style): + """ + Public method to check, if a style is a string style. + + @param style style to check (integer) + @return flag indicating a string style (boolean) + """ + return style in [ + QsciLexerIDL.DoubleQuotedString, + QsciLexerIDL.SingleQuotedString, + QsciLexerIDL.UnclosedString, + QsciLexerIDL.VerbatimString, + ] + + def defaultKeywords(self, kwSet): + """ + Public method to get the default keywords. + + @param kwSet number of the keyword set (integer) + @return string giving the keywords (string) or None + """ + return QsciLexerIDL.keywords(self, kwSet) + + def maximumKeywordSet(self): + """ + Public method to get the maximum keyword set. + + @return maximum keyword set (integer) + """ + return 4
--- a/ExtensionCorba/ProjectInterfacesBrowser.py Sun Dec 11 11:17:15 2022 +0100 +++ b/ExtensionCorba/ProjectInterfacesBrowser.py Mon Dec 12 16:43:08 2022 +0100 @@ -178,9 +178,7 @@ return EricPixmapCache.getIcon( os.path.join( - os.path.dirname(__file__), - "icons", - "projectInterfaces-{0}".format(iconSuffix), + os.path.dirname(__file__), "icons", "corba-{0}".format(iconSuffix) ) )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/icons/corba-dark.svg Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="22" height="22" version="1.1" viewBox="0 0 5.8208 5.8208" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -291.18)" fill="none"><circle cx="2.9101" cy="294.07" r="1.4302" stroke="#eff0f1" stroke-width=".61294"/><g transform="matrix(.43758 0 0 .43758 .12457 166.9)" stroke="#da4453"><rect x="4.259" y="290.41" width="5.9853" height=".43437" stroke-width=".8885"/><path transform="matrix(.99914 0 0 1.0004 .0035576 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/><path transform="matrix(-.99914 0 0 1.0004 12.729 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/></g></g></svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/icons/corba-light.svg Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="22" height="22" version="1.1" viewBox="0 0 5.8208 5.8208" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -291.18)" fill="none"><circle cx="2.9101" cy="294.07" r="1.4302" stroke="#232629" stroke-width=".61294"/><g transform="matrix(.43758 0 0 .43758 .12457 166.9)" stroke="#da4453"><rect x="4.259" y="290.41" width="5.9853" height=".43437" stroke-width=".8885"/><path transform="matrix(.99914 0 0 1.0004 .0035576 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/><path transform="matrix(-.99914 0 0 1.0004 12.729 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/></g></g></svg>
--- a/ExtensionCorba/icons/preferences-corba-dark.svg Sun Dec 11 11:17:15 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg enable-background="new 0 0 1000 1000" version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(.020408 0 0 .020401 .79577 .79924)" fill="#eff0f1"><g transform="matrix(.1 0 0 -.1 0 511)" fill="#eff0f1"><path d="m8366.8 5001c-345.6-42.7-837.7-189.1-1262.6-376.1-207.4-89.5-209.4-91.5-250.1-52.9-24.4 22.4-93.5 65.1-154.5 97.6-101.7 50.8-132.2 56.9-315.1 56.9-166.7 0-221.6-8.1-298.9-44.7-134.2-61-290.7-213.5-355.8-349.7-48.8-99.6-56.9-138.3-56.9-309v-193.2l-172.8-120c-95.6-65.1-270.4-193.2-392.4-282.6-213.5-158.6-235.8-193.2-126.1-195.2 22.4 0 117.9-26.4 213.5-59l172.8-59 512.4 362 115.9-69.1c227.7-136.2 479.8-148.4 711.6-34.6 248 122 380.2 335.5 394.4 636.4l8.1 174.8 217.6 93.5c951.5 404.6 1650.9 437.1 1964.1 89.5 278.5-309 282.6-925.1 12.2-1742.4-341.7-1032.9-1026.8-2161.3-2010.9-3312.1-453.4-528.6-1238.2-1293.1-1797.3-1748.5l-158.6-128.1-93.5 71.2c-195.2 150.5-394.4 215.5-660.8 215.5-298.9 0-549-103.7-764.5-317.2-260.2-260.2-372.1-662.8-280.6-1012.5 18.3-67.1 28.5-122 24.4-126-22.4-22.4-585.6-278.6-766.5-349.7-803.1-311.1-1482.2-390.4-1864.4-217.6-453.4 205.3-546.9 764.5-270.4 1626.5 69.1 211.4 213.5 563.2 319.2 770.6l59 117.9 183 4c150.5 2.1 199.2 12.2 292.8 57 225.7 109.8 390.4 343.6 418.8 591.6 16.3 144.4-30.5 335.5-113.9 461.5l-56.9 85.4 115.9 164.7 117.9 162.7-54.9 174.9c-30.5 95.6-63 205.4-73.2 244l-18.3 67.1-164.7-219.7c-89.5-122-185-254.1-211.5-292.8l-44.7-71.2h-207.4c-178.9 0-219.6-6.1-319.2-52.9-246-115.9-410.7-370-412.7-636.4 0-180.9 30.5-284.6 122-420.9l71.2-107.8-111.8-233.8c-752.3-1575.7-597.8-2671.6 414.8-2944 203.3-56.9 729.9-50.8 1034.9 10.2 453.4 91.5 925.1 256.2 1472 518.5l300.9 142.3 75.2-71.2c164.7-158.6 390.4-256.2 636.4-274.5 514.4-38.6 975.9 282.6 1124.4 784.8 46.8 160.6 42.7 433.1-10.2 601.8-34.6 113.8-36.6 142.3-14.2 162.7 14.2 12.2 136.2 113.8 268.4 225.7 1783 1476.2 3257 3458.6 3814.1 5127.8 160.6 481.9 211.5 760.4 211.5 1173.2 2 392.4-20.3 508.3-142.3 760.4-132.2 270.4-410.7 488-721.8 561.2-168.8 38.6-475.8 52.8-669 30.5zm-1838-703.5c152.5-73.2 217.5-300.9 126-435.1-77.2-111.8-148.4-152.5-270.4-152.5s-193.2 38.6-270.4 154.5c-61 87.4-54.9 244 12.2 337.5 85.5 120 262.3 162.7 402.6 95.6zm-5178.5-5081c154.5-79.3 215.5-248 148.4-402.6-56.9-128.1-148.4-187.1-288.7-187.1-187.1 0-309 120-309 307 0 231.9 248 386.4 449.3 282.7zm3523.5-1960c126.1-61 246-178.9 315.1-311.1 50.8-95.6 56.9-128.1 56.9-300.9 0-162.7-8.1-207.4-46.8-280.6-73.2-136.2-199.2-262.3-327.3-323.3-95.6-48.8-140.3-56.9-276.5-56.9-276.5 0-483.9 128.1-603.9 372.1-59 120-67.1 154.5-67.1 298.9 2 120 12.2 187.1 44.7 256.2 75.2 166.7 231.8 311.1 410.7 378.2 112 40.6 376.3 24.4 494.2-32.6z"/><path d="m3987.4 2874.2c-894.6-176.9-1579.8-868.2-1750.6-1762.8-38.6-207.4-38.6-593.7 0-801.1 170.8-904.8 880.4-1608.2 1777-1764.8 211.5-36.6 571.3-38.7 774.6-2.1 839.7 150.6 1516.8 778.9 1744.5 1614.5 46.8 176.9 52.9 233.8 52.9 553 2 327.3-2.1 372.1-54.9 557.1-233.8 843.8-902.7 1461.9-1740.4 1608.3-209.5 36.6-614.1 36.6-803.1-2.1z"/></g></g></svg>
--- a/ExtensionCorba/icons/preferences-corba-light.svg Sun Dec 11 11:17:15 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg enable-background="new 0 0 1000 1000" version="1.1" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(.020408 0 0 .020401 .79577 .79924)" fill="#232629"><g transform="matrix(.1 0 0 -.1 0 511)" fill="#232629"><path d="m8366.8 5001c-345.6-42.7-837.7-189.1-1262.6-376.1-207.4-89.5-209.4-91.5-250.1-52.9-24.4 22.4-93.5 65.1-154.5 97.6-101.7 50.8-132.2 56.9-315.1 56.9-166.7 0-221.6-8.1-298.9-44.7-134.2-61-290.7-213.5-355.8-349.7-48.8-99.6-56.9-138.3-56.9-309v-193.2l-172.8-120c-95.6-65.1-270.4-193.2-392.4-282.6-213.5-158.6-235.8-193.2-126.1-195.2 22.4 0 117.9-26.4 213.5-59l172.8-59 512.4 362 115.9-69.1c227.7-136.2 479.8-148.4 711.6-34.6 248 122 380.2 335.5 394.4 636.4l8.1 174.8 217.6 93.5c951.5 404.6 1650.9 437.1 1964.1 89.5 278.5-309 282.6-925.1 12.2-1742.4-341.7-1032.9-1026.8-2161.3-2010.9-3312.1-453.4-528.6-1238.2-1293.1-1797.3-1748.5l-158.6-128.1-93.5 71.2c-195.2 150.5-394.4 215.5-660.8 215.5-298.9 0-549-103.7-764.5-317.2-260.2-260.2-372.1-662.8-280.6-1012.5 18.3-67.1 28.5-122 24.4-126-22.4-22.4-585.6-278.6-766.5-349.7-803.1-311.1-1482.2-390.4-1864.4-217.6-453.4 205.3-546.9 764.5-270.4 1626.5 69.1 211.4 213.5 563.2 319.2 770.6l59 117.9 183 4c150.5 2.1 199.2 12.2 292.8 57 225.7 109.8 390.4 343.6 418.8 591.6 16.3 144.4-30.5 335.5-113.9 461.5l-56.9 85.4 115.9 164.7 117.9 162.7-54.9 174.9c-30.5 95.6-63 205.4-73.2 244l-18.3 67.1-164.7-219.7c-89.5-122-185-254.1-211.5-292.8l-44.7-71.2h-207.4c-178.9 0-219.6-6.1-319.2-52.9-246-115.9-410.7-370-412.7-636.4 0-180.9 30.5-284.6 122-420.9l71.2-107.8-111.8-233.8c-752.3-1575.7-597.8-2671.6 414.8-2944 203.3-56.9 729.9-50.8 1034.9 10.2 453.4 91.5 925.1 256.2 1472 518.5l300.9 142.3 75.2-71.2c164.7-158.6 390.4-256.2 636.4-274.5 514.4-38.6 975.9 282.6 1124.4 784.8 46.8 160.6 42.7 433.1-10.2 601.8-34.6 113.8-36.6 142.3-14.2 162.7 14.2 12.2 136.2 113.8 268.4 225.7 1783 1476.2 3257 3458.6 3814.1 5127.8 160.6 481.9 211.5 760.4 211.5 1173.2 2 392.4-20.3 508.3-142.3 760.4-132.2 270.4-410.7 488-721.8 561.2-168.8 38.6-475.8 52.8-669 30.5zm-1838-703.5c152.5-73.2 217.5-300.9 126-435.1-77.2-111.8-148.4-152.5-270.4-152.5s-193.2 38.6-270.4 154.5c-61 87.4-54.9 244 12.2 337.5 85.5 120 262.3 162.7 402.6 95.6zm-5178.5-5081c154.5-79.3 215.5-248 148.4-402.6-56.9-128.1-148.4-187.1-288.7-187.1-187.1 0-309 120-309 307 0 231.9 248 386.4 449.3 282.7zm3523.5-1960c126.1-61 246-178.9 315.1-311.1 50.8-95.6 56.9-128.1 56.9-300.9 0-162.7-8.1-207.4-46.8-280.6-73.2-136.2-199.2-262.3-327.3-323.3-95.6-48.8-140.3-56.9-276.5-56.9-276.5 0-483.9 128.1-603.9 372.1-59 120-67.1 154.5-67.1 298.9 2 120 12.2 187.1 44.7 256.2 75.2 166.7 231.8 311.1 410.7 378.2 112 40.6 376.3 24.4 494.2-32.6z"/><path d="m3987.4 2874.2c-894.6-176.9-1579.8-868.2-1750.6-1762.8-38.6-207.4-38.6-593.7 0-801.1 170.8-904.8 880.4-1608.2 1777-1764.8 211.5-36.6 571.3-38.7 774.6-2.1 839.7 150.6 1516.8 778.9 1744.5 1614.5 46.8 176.9 52.9 233.8 52.9 553 2 327.3-2.1 372.1-54.9 557.1-233.8 843.8-902.7 1461.9-1740.4 1608.3-209.5 36.6-614.1 36.6-803.1-2.1z"/></g></g></svg>
--- a/ExtensionCorba/icons/projectInterfaces-dark.svg Sun Dec 11 11:17:15 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg width="22" height="22" version="1.1" viewBox="0 0 5.8208 5.8208" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -291.18)" fill="none"><circle cx="2.9101" cy="294.07" r="1.4302" stroke="#eff0f1" stroke-width=".61294"/><g transform="matrix(.43758 0 0 .43758 .12457 166.9)" stroke="#da4453"><rect x="4.259" y="290.41" width="5.9853" height=".43437" stroke-width=".8885"/><path transform="matrix(.99914 0 0 1.0004 .0035576 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/><path transform="matrix(-.99914 0 0 1.0004 12.729 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/></g></g></svg>
--- a/ExtensionCorba/icons/projectInterfaces-light.svg Sun Dec 11 11:17:15 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<svg width="22" height="22" version="1.1" viewBox="0 0 5.8208 5.8208" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 -291.18)" fill="none"><circle cx="2.9101" cy="294.07" r="1.4302" stroke="#232629" stroke-width=".61294"/><g transform="matrix(.43758 0 0 .43758 .12457 166.9)" stroke="#da4453"><rect x="4.259" y="290.41" width="5.9853" height=".43437" stroke-width=".8885"/><path transform="matrix(.99914 0 0 1.0004 .0035576 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/><path transform="matrix(-.99914 0 0 1.0004 12.729 -.13862)" d="m11.471 290.65-0.86826 0.50129v-1.0026z" stroke-width=".94873"/></g></g></svg>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExtensionCorba/idlclbr.py Mon Dec 12 16:43:08 2022 +0100 @@ -0,0 +1,423 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2005 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Parse a CORBA IDL file and retrieve modules, interfaces, methods and +attributes. + +Parse enough of a CORBA IDL file to recognize module, interface and method +definitions and to find out the superclasses of an interface as well as its +attributes. + +It is based on the Python class browser found in this package. +""" + +import os +import re + +from eric7 import Utilities +from eric7.Utilities.ClassBrowsers import ClbrBaseClasses + +_getnext = re.compile( + r""" + (?P<String> + " [^"\\\n]* (?: \\. [^"\\\n]*)* " + ) + +| (?P<Comment> + ^ [ \t]* // .*? $ + | + ^ [ \t]* /\* .*? \*/ + ) + +| (?P<Method> + ^ + (?P<MethodIndent> [ \t]* ) + (?: oneway [ \t]+ )? + (?: [a-zA-Z0-9_:]+ | void ) [ \t]* + (?P<MethodName> [a-zA-Z_] [a-zA-Z0-9_]* ) + [ \t]* + \( + (?P<MethodSignature> [^)]*? ) + \); + [ \t]* + ) + +| (?P<Interface> + ^ + (?P<InterfaceIndent> [ \t]* ) + (?: abstract [ \t]+ )? + interface [ \t]+ + (?P<InterfaceName> [a-zA-Z_] [a-zA-Z0-9_]* ) + [ \t]* + (?P<InterfaceSupers> : [^{]+? )? + [ \t]* { + ) + +| (?P<Module> + ^ + (?P<ModuleIndent> [ \t]* ) + module [ \t]+ + (?P<ModuleName> [a-zA-Z_] [a-zA-Z0-9_]* ) + [ \t]* { + ) + +| (?P<Attribute> + ^ + (?P<AttributeIndent> [ \t]* ) + (?P<AttributeReadonly> readonly [ \t]+ )? + attribute [ \t]+ + (?P<AttributeType> (?: [a-zA-Z0-9_:]+ [ \t]+ )+ ) + (?P<AttributeNames> [^;]* ) + ; + ) + +| (?P<Begin> + [ \t]* { + ) + +| (?P<End> + [ \t]* } [ \t]* ; + )""", + re.VERBOSE | re.DOTALL | re.MULTILINE, +).search + +# function to replace comments +_commentsub = re.compile(r"""//[^\n]*\n|//[^\n]*$""").sub +# function to normalize whitespace +_normalize = re.compile(r"""[ \t]{2,}""").sub + + +class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase): + """ + Mixin class implementing the notion of visibility. + """ + + def __init__(self): + """ + Constructor + """ + self.setPublic() + + +class Module(ClbrBaseClasses.Module, VisibilityMixin): + """ + Class to represent a CORBA IDL module. + """ + + def __init__(self, module, name, file, lineno): + """ + Constructor + + @param module name of the module containing this module + @type str + @param name name of this module + @type str + @param file filename containing this module + @type str + @param lineno line number of the module definition + @type int + """ + ClbrBaseClasses.Module.__init__(self, module, name, file, lineno) + VisibilityMixin.__init__(self) + + +class Interface(ClbrBaseClasses.Class, VisibilityMixin): + """ + Class to represent a CORBA IDL interface. + """ + + def __init__(self, module, name, superClasses, file, lineno): + """ + Constructor + + @param module name of the module containing this interface + @type str + @param name name of this interface + @type str + @param superClasses list of interface names this interface is + inherited from + @type list of str + @param file filename containing this interface + @type str + @param lineno line number of the interface definition + @type int + """ + ClbrBaseClasses.Class.__init__(self, module, name, superClasses, file, lineno) + VisibilityMixin.__init__(self) + + +class Function(ClbrBaseClasses.Function, VisibilityMixin): + """ + Class to represent a CORBA IDL function. + """ + + def __init__(self, module, name, file, lineno, signature="", separator=","): + """ + Constructor + + @param module name of the module containing this function + @type str + @param name name of this function + @type str + @param file filename containing this function + @type str + @param lineno line number of the function definition + @type int + @param signature parameter list of the function + @type str + @param separator string separating the parameters + @type str + """ + ClbrBaseClasses.Function.__init__( + self, module, name, file, lineno, signature, separator + ) + VisibilityMixin.__init__(self) + + +class Attribute(ClbrBaseClasses.Attribute, VisibilityMixin): + """ + Class to represent a CORBA IDL attribute. + """ + + def __init__(self, module, name, file, lineno): + """ + Constructor + + @param module name of the module containing this attribute + @type str + @param name name of this attribute + @type str + @param file filename containing this attribute + @type str + @param lineno line number of the attribute definition + @type int + """ + ClbrBaseClasses.Attribute.__init__(self, module, name, file, lineno) + VisibilityMixin.__init__(self) + + +def readmodule_ex(module, path=None): + """ + Read a CORBA IDL file and return a dictionary of classes, functions and + modules. + + @param module name of the IDL file + @type str + @param path path the file should be searched in + @type list of str + @return the resulting dictionary + @rtype dict + """ + path = [] if path is None else path[:] + for p in path: # search in path + pathname = os.path.join(p, module) + if os.path.exists(pathname): + filename = pathname + try: + src = Utilities.readEncodedFile(filename)[0] + except (UnicodeError, OSError): + # can't do anything with this module + return {} + + return scan(src, filename, module) + return {} + + +def scan(src, file, module): + """ + Public method to scan the given source text. + + @param src source text to be scanned + @type str + @param file file name associated with the source text + @type str + @param module module name associated with the source text + @type str + @return dictionary containing the extracted data + @rtype dict + """ + + def calculateEndline(lineno, lines): + """ + Function to calculate the end line. + + @param lineno line number to start at (one based) + @type int + @param lines list of source lines + @type list of str + @return end line (one based) + @rtype int + """ + # convert lineno to be zero based + lineno -= 1 + # 1. search for opening brace '{' + while lineno < len(lines) and "{" not in lines[lineno]: + lineno += 1 + depth = lines[lineno].count("{") - lines[lineno].count("}") + # 2. search for ending line, i.e. matching closing brace '}' + while depth > 0 and lineno < len(lines) - 1: + lineno += 1 + depth += lines[lineno].count("{") - lines[lineno].count("}") + if depth == 0: + # found a matching brace + return lineno + 1 + else: + # nothing found + return -1 + + def calculateMethodEndline(lineno, lines): + """ + Function to calculate the end line. + + @param lineno line number to start at (one based) + @type int + @param lines list of source lines + @type list of str + @return end line (one based) + @rtype int + """ + # convert lineno to be zero based + lineno -= 1 + while lineno < len(lines) and ";" not in lines[lineno]: + lineno += 1 + if ";" in lines[lineno]: + # found an end indicator, i.e. ';' + return lineno + 1 + else: + return -1 + + # convert eol markers the Python style + src = src.replace("\r\n", "\n").replace("\r", "\n") + srcLines = src.splitlines() + + dictionary = {} + dict_counts = {} + + classstack = [] # stack of (class, indent) pairs + indent = 0 + + lineno, last_lineno_pos = 1, 0 + i = 0 + while True: + m = _getnext(src, i) + if not m: + break + start, i = m.span() + + if m.start("Method") >= 0: + # found a method definition or function + thisindent = indent + meth_name = m.group("MethodName") + meth_sig = m.group("MethodSignature") + meth_sig = meth_sig and meth_sig.replace("\\\n", "") or "" + meth_sig = _commentsub("", meth_sig) + meth_sig = _normalize(" ", meth_sig) + lineno += src.count("\n", last_lineno_pos, start) + last_lineno_pos = start + # close all interfaces/modules indented at least as much + while classstack and classstack[-1][1] >= thisindent: + del classstack[-1] + if classstack: + # it's an interface/module method + cur_class = classstack[-1][0] + if isinstance(cur_class, (Interface, Module)): + # it's a method + f = Function(None, meth_name, file, lineno, meth_sig) + cur_class._addmethod(meth_name, f) + # else it's a nested def + else: + f = None + else: + # it's a function + f = Function(module, meth_name, file, lineno, meth_sig) + if meth_name in dict_counts: + dict_counts[meth_name] += 1 + meth_name = "{0}_{1:d}".format(meth_name, dict_counts[meth_name]) + else: + dict_counts[meth_name] = 0 + dictionary[meth_name] = f + if f: + endline = calculateMethodEndline(lineno, srcLines) + f.setEndLine(endline) + classstack.append((f, thisindent)) # Marker for nested fns + + elif m.start("String") >= 0 or m.start("Comment") >= 0: + pass + + elif m.start("Interface") >= 0: + # we found an interface definition + thisindent = indent + indent += 1 + # close all interfaces/modules indented at least as much + while classstack and classstack[-1][1] >= thisindent: + del classstack[-1] + lineno += src.count("\n", last_lineno_pos, start) + last_lineno_pos = start + class_name = m.group("InterfaceName") + inherit = m.group("InterfaceSupers") + if inherit: + # the interface inherits from other interfaces + inherit = inherit[1:].strip() + inherit = [_commentsub("", inherit)] + # remember this interface + cur_class = Interface(module, class_name, inherit, file, lineno) + endline = calculateEndline(lineno, srcLines) + cur_class.setEndLine(endline) + if not classstack: + dictionary[class_name] = cur_class + else: + cls = classstack[-1][0] + cls._addclass(class_name, cur_class) + classstack.append((cur_class, thisindent)) + + elif m.start("Module") >= 0: + # we found a module definition + thisindent = indent + indent += 1 + # close all interfaces/modules indented at least as much + while classstack and classstack[-1][1] >= thisindent: + del classstack[-1] + lineno += src.count("\n", last_lineno_pos, start) + last_lineno_pos = start + module_name = m.group("ModuleName") + # remember this module + cur_class = Module(module, module_name, file, lineno) + endline = calculateEndline(lineno, srcLines) + cur_class.setEndLine(endline) + if not classstack: + dictionary[module_name] = cur_class + classstack.append((cur_class, thisindent)) + + elif m.start("Attribute") >= 0: + lineno += src.count("\n", last_lineno_pos, start) + last_lineno_pos = start + index = -1 + while index >= -len(classstack): + if ( + classstack[index][0] is not None + and not isinstance(classstack[index][0], Function) + and classstack[index][1] < indent + ): + attributes = m.group("AttributeNames").split(",") + ro = m.group("AttributeReadonly") + for attribute in attributes: + attr = Attribute(module, attribute, file, lineno) + if ro: + attr.setPrivate() + classstack[index][0]._addattribute(attr) + break + else: + index -= 1 + + elif m.start("Begin") >= 0: + # a begin of a block we are not interested in + indent += 1 + + elif m.start("End") >= 0: + # an end of a block + indent -= 1 + + return dictionary
--- a/PKGLIST Sun Dec 11 11:17:15 2022 +0100 +++ b/PKGLIST Mon Dec 12 16:43:08 2022 +0100 @@ -6,16 +6,16 @@ ExtensionCorba/IdlCompilerDefineNameDialog.ui ExtensionCorba/IdlCompilerOptionsDialog.py ExtensionCorba/IdlCompilerOptionsDialog.ui +ExtensionCorba/LexerIDL.py ExtensionCorba/ProjectInterfacesBrowser.py ExtensionCorba/__init__.py ExtensionCorba/i18n/corba_de.qm ExtensionCorba/i18n/corba_en.qm ExtensionCorba/i18n/corba_es.qm ExtensionCorba/i18n/corba_ru.qm +ExtensionCorba/icons/corba-dark.svg +ExtensionCorba/icons/corba-light.svg ExtensionCorba/icons/corba48-dark.svg ExtensionCorba/icons/corba48-light.svg -ExtensionCorba/icons/preferences-corba-dark.svg -ExtensionCorba/icons/preferences-corba-light.svg -ExtensionCorba/icons/projectInterfaces-dark.svg -ExtensionCorba/icons/projectInterfaces-light.svg +ExtensionCorba/idlclbr.py PluginExtensionCorba.py
--- a/PluginCorba.epj Sun Dec 11 11:17:15 2022 +0100 +++ b/PluginCorba.epj Mon Dec 12 16:43:08 2022 +0100 @@ -197,12 +197,10 @@ ".hgignore", "ExtensionCorba/Documentation/LICENSE.GPL3", "ExtensionCorba/Documentation/source", + "ExtensionCorba/icons/corba-dark.svg", + "ExtensionCorba/icons/corba-light.svg", "ExtensionCorba/icons/corba48-dark.svg", "ExtensionCorba/icons/corba48-light.svg", - "ExtensionCorba/icons/preferences-corba-dark.svg", - "ExtensionCorba/icons/preferences-corba-light.svg", - "ExtensionCorba/icons/projectInterfaces-dark.svg", - "ExtensionCorba/icons/projectInterfaces-light.svg", "PKGLIST", "PluginCorba.epj", "PluginExtensionCorba.zip", @@ -261,8 +259,10 @@ "ExtensionCorba/ConfigurationPage/__init__.py", "ExtensionCorba/IdlCompilerDefineNameDialog.py", "ExtensionCorba/IdlCompilerOptionsDialog.py", + "ExtensionCorba/LexerIDL.py", "ExtensionCorba/ProjectInterfacesBrowser.py", "ExtensionCorba/__init__.py", + "ExtensionCorba/idlclbr.py", "PluginExtensionCorba.py", "__init__.py" ],
--- a/PluginExtensionCorba.py Sun Dec 11 11:17:15 2022 +0100 +++ b/PluginExtensionCorba.py Mon Dec 12 16:43:08 2022 +0100 @@ -14,6 +14,7 @@ from eric7 import Globals, Preferences from eric7.EricWidgets import EricMessageBox from eric7.EricWidgets.EricApplication import ericApp +from ExtensionCorba import idlclbr from ExtensionCorba.ProjectInterfacesBrowser import ProjectInterfacesBrowser # Start-Of-Header @@ -21,7 +22,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "10.0.2" +version = "10.1.0" className = "CorbaExtensionPlugin" packageName = "ExtensionCorba" shortDescription = "Support for the development of CORBA projects" @@ -95,9 +96,7 @@ return { "corbaPage": [ QCoreApplication.translate("CorbaExtensionPlugin", "CORBA"), - os.path.join( - "ExtensionCorba", "icons", "preferences-corba-{0}".format(iconSuffix) - ), + os.path.join("ExtensionCorba", "icons", "corba-{0}".format(iconSuffix)), createCorbaPage, None, None, @@ -170,6 +169,9 @@ @return tuple of None and activation status @rtype bool """ + from eric7.QScintilla import Lexers + from eric7.Utilities import ClassBrowsers + global error, corbaExtensionPluginObject error = "" # clear previous error @@ -178,6 +180,22 @@ self.__browser = ProjectInterfacesBrowser(self) + iconSuffix = "dark" if ericApp().usesDarkPalette() else "light" + Lexers.registerLexer( + "IDL", + self.tr("IDL"), + "dummy.idl", + self.getLexer, + [self.tr("Corba IDL Files (*.idl)")], + [self.tr("Corba IDL Files (*.idl)")], + ["*.idl"], + os.path.join("ExtensionCorba", "icons", "corba-{0}".format(iconSuffix)), + ) + + ClassBrowsers.registerClassBrowser( + "IDL", idlclbr.readmodule_ex, idlclbr.scan, self.getFileIcon, [".idl"] + ) + return None, True else: EricMessageBox.warning( @@ -199,6 +217,12 @@ """ Public method to deactivate this plug-in. """ + from eric7.QScintilla import Lexers + from eric7.Utilities import ClassBrowsers + + Lexers.unregisterLexer("IDL") + ClassBrowsers.registerClassBrowser("IDL") + self.__browser.deactivate() self.__initialize() @@ -250,6 +274,31 @@ """ Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value) + def getLexer(self, parent=None): + """ + Public method to instantiate a QScintilla CORBA IDL lexer object. + + @param parent reference to the parent object + @type QObject + @return reference to the instanciated lexer object + @rtype QsciLexer + """ + from ExtensionCorba.LexerIDL import LexerIDL + + return LexerIDL(parent=parent) + + def getFileIcon(self, filename=""): + """ + Public method to get the name of a file icon. + + @param filename file name (defaults to "") + @type str (optional) + @return name of a file icon + @rtype str + """ + iconSuffix = "dark" if ericApp().usesDarkPalette() else "light" + return os.path.join("ExtensionCorba", "icons", "corba-{0}".format(iconSuffix)) + # # eflag: noqa = M801