Sun, 04 Dec 2022 14:32:07 +0100
First incarnation of the Protobuf and gRPC support plugin, that was an integral part of eric7 previously.
<!DOCTYPE html> <html><head> <title>Plugin_Extension_Protobuf.ExtensionProtobuf.ProjectProtocolsBrowser</title> <meta charset="UTF-8"> <link rel="stylesheet" href="styles.css"> </head> <body> <a NAME="top" ID="top"></a> <h1>Plugin_Extension_Protobuf.ExtensionProtobuf.ProjectProtocolsBrowser</h1> <p> Module implementing the a class used to display the protocols (protobuf) part of the project. </p> <h3>Global Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#ProjectProtocolsBrowser">ProjectProtocolsBrowser</a></td> <td>A class used to display the protocols (protobuf) part of the project.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /> <hr /> <a NAME="ProjectProtocolsBrowser" ID="ProjectProtocolsBrowser"></a> <h2>ProjectProtocolsBrowser</h2> <p> A class used to display the protocols (protobuf) part of the project. </p> <h3>Signals</h3> <dl> <dt>appendStderr(str)</dt> <dd> emitted after something was received from a QProcess on stderr </dd> <dt>appendStdout(str)</dt> <dd> emitted after something was received from a QProcess on stdout </dd> <dt>showMenu(str, QMenu)</dt> <dd> emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given. </dd> </dl> <h3>Derived from</h3> ProjectBaseBrowser <h3>Class Attributes</h3> <table> <tr><td>FileFilter</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#ProjectProtocolsBrowser.__init__">ProjectProtocolsBrowser</a></td> <td>Constructor</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__addProtocolFiles">__addProtocolFiles</a></td> <td>Private method to add protocol files to the project.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__addProtocolsDirectory">__addProtocolsDirectory</a></td> <td>Private method to add protocol files of a directory to the project.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__compileAllProtocols">__compileAllProtocols</a></td> <td>Private method to compile all protocols to Python.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__compileProto">__compileProto</a></td> <td>Private method to compile a .proto file to Python.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__compileProtoDone">__compileProtoDone</a></td> <td>Private slot to handle the finished signal of the protoc process.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__compileProtocol">__compileProtocol</a></td> <td>Private method to compile a protocol to Python.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__compileSelectedProtocols">__compileSelectedProtocols</a></td> <td>Private method to compile selected protocols to Python.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__configureProtobuf">__configureProtobuf</a></td> <td>Private method to open the configuration dialog.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__deleteFile">__deleteFile</a></td> <td>Private method to delete files from the project.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__getCompilerCommand">__getCompilerCommand</a></td> <td>Private method to get the compiler command.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__readStderr">__readStderr</a></td> <td>Private slot to handle the readyReadStandardError signal of the protoc process.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__readStdout">__readStdout</a></td> <td>Private slot to handle the readyReadStandardOutput signal of the protoc process.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__showContextMenu">__showContextMenu</a></td> <td>Private slot called by the menu aboutToShow signal.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__showContextMenuBack">__showContextMenuBack</a></td> <td>Private slot called by the backMenu aboutToShow signal.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__showContextMenuDir">__showContextMenuDir</a></td> <td>Private slot called by the dirMenu aboutToShow signal.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__showContextMenuDirMulti">__showContextMenuDirMulti</a></td> <td>Private slot called by the dirMultiMenu aboutToShow signal.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.__showContextMenuMulti">__showContextMenuMulti</a></td> <td>Private slot called by the multiMenu aboutToShow signal.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser._contextMenuRequested">_contextMenuRequested</a></td> <td>Protected slot to show the context menu.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser._createPopupMenus">_createPopupMenus</a></td> <td>Protected overloaded method to generate the popup menu.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser._openItem">_openItem</a></td> <td>Protected slot to handle the open popup menu entry.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.deactivate">deactivate</a></td> <td>Public method to deactivate the browser.</td> </tr> <tr> <td><a href="#ProjectProtocolsBrowser.getIcon">getIcon</a></td> <td>Public method to get an icon for the project browser.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="ProjectProtocolsBrowser.__init__" ID="ProjectProtocolsBrowser.__init__"></a> <h4>ProjectProtocolsBrowser (Constructor)</h4> <b>ProjectProtocolsBrowser</b>(<i>plugin, parent=None</i>) <p> Constructor </p> <dl> <dt><i>plugin</i> (ProtobufExtensionPlugin)</dt> <dd> reference to the plugin object </dd> <dt><i>parent</i> (QWidget)</dt> <dd> parent widget of this browser </dd> </dl> <a NAME="ProjectProtocolsBrowser.__addProtocolFiles" ID="ProjectProtocolsBrowser.__addProtocolFiles"></a> <h4>ProjectProtocolsBrowser.__addProtocolFiles</h4> <b>__addProtocolFiles</b>(<i></i>) <p> Private method to add protocol files to the project. </p> <a NAME="ProjectProtocolsBrowser.__addProtocolsDirectory" ID="ProjectProtocolsBrowser.__addProtocolsDirectory"></a> <h4>ProjectProtocolsBrowser.__addProtocolsDirectory</h4> <b>__addProtocolsDirectory</b>(<i></i>) <p> Private method to add protocol files of a directory to the project. </p> <a NAME="ProjectProtocolsBrowser.__compileAllProtocols" ID="ProjectProtocolsBrowser.__compileAllProtocols"></a> <h4>ProjectProtocolsBrowser.__compileAllProtocols</h4> <b>__compileAllProtocols</b>(<i>grpc=False</i>) <p> Private method to compile all protocols to Python. </p> <dl> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to compile as gRPC files </dd> </dl> <a NAME="ProjectProtocolsBrowser.__compileProto" ID="ProjectProtocolsBrowser.__compileProto"></a> <h4>ProjectProtocolsBrowser.__compileProto</h4> <b>__compileProto</b>(<i>fn, noDialog=False, progress=None, grpc=False</i>) <p> Private method to compile a .proto file to Python. </p> <dl> <dt><i>fn</i> (str)</dt> <dd> filename of the .proto file to be compiled </dd> <dt><i>noDialog</i> (bool)</dt> <dd> flag indicating silent operations </dd> <dt><i>progress</i> (EricProgressDialog)</dt> <dd> reference to the progress dialog </dd> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to compile as gRPC files </dd> </dl> <dl> <dt>Return:</dt> <dd> reference to the compile process </dd> </dl> <dl> <dt>Return Type:</dt> <dd> QProcess </dd> </dl> <a NAME="ProjectProtocolsBrowser.__compileProtoDone" ID="ProjectProtocolsBrowser.__compileProtoDone"></a> <h4>ProjectProtocolsBrowser.__compileProtoDone</h4> <b>__compileProtoDone</b>(<i>exitCode, exitStatus, grpc</i>) <p> Private slot to handle the finished signal of the protoc process. </p> <dl> <dt><i>exitCode</i> (int)</dt> <dd> exit code of the process </dd> <dt><i>exitStatus</i> (QProcess.ExitStatus)</dt> <dd> exit status of the process </dd> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to compile as gRPC files </dd> </dl> <a NAME="ProjectProtocolsBrowser.__compileProtocol" ID="ProjectProtocolsBrowser.__compileProtocol"></a> <h4>ProjectProtocolsBrowser.__compileProtocol</h4> <b>__compileProtocol</b>(<i>grpc=False</i>) <p> Private method to compile a protocol to Python. </p> <dl> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to compile as gRPC files </dd> </dl> <a NAME="ProjectProtocolsBrowser.__compileSelectedProtocols" ID="ProjectProtocolsBrowser.__compileSelectedProtocols"></a> <h4>ProjectProtocolsBrowser.__compileSelectedProtocols</h4> <b>__compileSelectedProtocols</b>(<i>grpc=False</i>) <p> Private method to compile selected protocols to Python. </p> <dl> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to compile as gRPC files </dd> </dl> <a NAME="ProjectProtocolsBrowser.__configureProtobuf" ID="ProjectProtocolsBrowser.__configureProtobuf"></a> <h4>ProjectProtocolsBrowser.__configureProtobuf</h4> <b>__configureProtobuf</b>(<i></i>) <p> Private method to open the configuration dialog. </p> <a NAME="ProjectProtocolsBrowser.__deleteFile" ID="ProjectProtocolsBrowser.__deleteFile"></a> <h4>ProjectProtocolsBrowser.__deleteFile</h4> <b>__deleteFile</b>(<i></i>) <p> Private method to delete files from the project. </p> <a NAME="ProjectProtocolsBrowser.__getCompilerCommand" ID="ProjectProtocolsBrowser.__getCompilerCommand"></a> <h4>ProjectProtocolsBrowser.__getCompilerCommand</h4> <b>__getCompilerCommand</b>(<i>grpc</i>) <p> Private method to get the compiler command. </p> <dl> <dt><i>grpc</i> (bool)</dt> <dd> flag indicating to get a gRPC command </dd> </dl> <dl> <dt>Return:</dt> <dd> tuple giving the executable and its parameter list </dd> </dl> <dl> <dt>Return Type:</dt> <dd> tuple of (str, list of str) </dd> </dl> <a NAME="ProjectProtocolsBrowser.__readStderr" ID="ProjectProtocolsBrowser.__readStderr"></a> <h4>ProjectProtocolsBrowser.__readStderr</h4> <b>__readStderr</b>(<i></i>) <p> Private slot to handle the readyReadStandardError signal of the protoc process. </p> <a NAME="ProjectProtocolsBrowser.__readStdout" ID="ProjectProtocolsBrowser.__readStdout"></a> <h4>ProjectProtocolsBrowser.__readStdout</h4> <b>__readStdout</b>(<i></i>) <p> Private slot to handle the readyReadStandardOutput signal of the protoc process. </p> <a NAME="ProjectProtocolsBrowser.__showContextMenu" ID="ProjectProtocolsBrowser.__showContextMenu"></a> <h4>ProjectProtocolsBrowser.__showContextMenu</h4> <b>__showContextMenu</b>(<i></i>) <p> Private slot called by the menu aboutToShow signal. </p> <a NAME="ProjectProtocolsBrowser.__showContextMenuBack" ID="ProjectProtocolsBrowser.__showContextMenuBack"></a> <h4>ProjectProtocolsBrowser.__showContextMenuBack</h4> <b>__showContextMenuBack</b>(<i></i>) <p> Private slot called by the backMenu aboutToShow signal. </p> <a NAME="ProjectProtocolsBrowser.__showContextMenuDir" ID="ProjectProtocolsBrowser.__showContextMenuDir"></a> <h4>ProjectProtocolsBrowser.__showContextMenuDir</h4> <b>__showContextMenuDir</b>(<i></i>) <p> Private slot called by the dirMenu aboutToShow signal. </p> <a NAME="ProjectProtocolsBrowser.__showContextMenuDirMulti" ID="ProjectProtocolsBrowser.__showContextMenuDirMulti"></a> <h4>ProjectProtocolsBrowser.__showContextMenuDirMulti</h4> <b>__showContextMenuDirMulti</b>(<i></i>) <p> Private slot called by the dirMultiMenu aboutToShow signal. </p> <a NAME="ProjectProtocolsBrowser.__showContextMenuMulti" ID="ProjectProtocolsBrowser.__showContextMenuMulti"></a> <h4>ProjectProtocolsBrowser.__showContextMenuMulti</h4> <b>__showContextMenuMulti</b>(<i></i>) <p> Private slot called by the multiMenu aboutToShow signal. </p> <a NAME="ProjectProtocolsBrowser._contextMenuRequested" ID="ProjectProtocolsBrowser._contextMenuRequested"></a> <h4>ProjectProtocolsBrowser._contextMenuRequested</h4> <b>_contextMenuRequested</b>(<i>coord</i>) <p> Protected slot to show the context menu. </p> <dl> <dt><i>coord</i></dt> <dd> the position of the mouse pointer (QPoint) </dd> </dl> <a NAME="ProjectProtocolsBrowser._createPopupMenus" ID="ProjectProtocolsBrowser._createPopupMenus"></a> <h4>ProjectProtocolsBrowser._createPopupMenus</h4> <b>_createPopupMenus</b>(<i></i>) <p> Protected overloaded method to generate the popup menu. </p> <a NAME="ProjectProtocolsBrowser._openItem" ID="ProjectProtocolsBrowser._openItem"></a> <h4>ProjectProtocolsBrowser._openItem</h4> <b>_openItem</b>(<i></i>) <p> Protected slot to handle the open popup menu entry. </p> <a NAME="ProjectProtocolsBrowser.deactivate" ID="ProjectProtocolsBrowser.deactivate"></a> <h4>ProjectProtocolsBrowser.deactivate</h4> <b>deactivate</b>(<i></i>) <p> Public method to deactivate the browser. </p> <a NAME="ProjectProtocolsBrowser.getIcon" ID="ProjectProtocolsBrowser.getIcon"></a> <h4>ProjectProtocolsBrowser.getIcon</h4> <b>getIcon</b>(<i></i>) <p> Public method to get an icon for the project browser. </p> <dl> <dt>Return:</dt> <dd> icon for the browser </dd> </dl> <dl> <dt>Return Type:</dt> <dd> QIcon </dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>