# eric6.Project.ProjectProtocolsBrowser

Module implementing the a class used to display the protocols (protobuf) part of the project.

### Global Attributes

None

### Classes

ProjectProtocolsBrowser | A class used to display the protocols (protobuf) part of the project.

### Functions

None

## ProjectProtocolsBrowser

A class used to display the protocols (protobuf) part of the project.

### Signals

appendStderr(str)
  emitted after something was received from a QProcess on stderr
appendStdout(str)
  emitted after something was received from a QProcess on stdout
showMenu(str, QMenu)
  emitted when a menu is about to be shown. The name of the menu and a reference to the menu are given.

### Derived from

ProjectBaseBrowser

### Class Attributes

None

### Class Methods

None

### Methods

ProjectProtocolsBrowser | Constructor
__addProtocolFiles | Private method to add protocol files to the project.
__addProtocolsDirectory | Private method to add protocol files of a directory to the project.
__compileAllProtocols | Private method to compile all protocols to Python.
__compileProto | Private method to compile a .proto file to Python.
__compileProtoDone | Private slot to handle the finished signal of the protoc process.
__compileProtocol | Private method to compile a protocol to Python.
__compileSelectedProtocols | Private method to compile selected protocols to Python.
__configureProtobuf | Private method to open the configuration dialog.
__deleteFile | Private method to delete files from the project.
__getCompilerCommand | Private method to get the compiler command.
__readStderr | Private slot to handle the readyReadStandardError signal of the protoc process.
__readStdout | Private slot to handle the readyReadStandardOutput signal of the protoc process.
__showContextMenu | Private slot called by the menu aboutToShow signal.
__showContextMenuBack | Private slot called by the backMenu aboutToShow signal.
__showContextMenuDir | Private slot called by the dirMenu aboutToShow signal.
__showContextMenuDirMulti | Private slot called by the dirMultiMenu aboutToShow signal.
__showContextMenuMulti | Private slot called by the multiMenu aboutToShow signal.
_contextMenuRequested | Protected slot to show the context menu.
_createPopupMenus | Protected overloaded method to generate the popup menu.
_openItem | Protected slot to handle the open popup menu entry.

### Static Methods

None

#### ProjectProtocolsBrowser (Constructor)

ProjectProtocolsBrowser(project, parent=None)

Constructor

project (Project)
  reference to the project object
parent (QWidget)
  parent widget of this browser

#### ProjectProtocolsBrowser.__addProtocolFiles

__addProtocolFiles()

Private method to add protocol files to the project.

#### ProjectProtocolsBrowser.__addProtocolsDirectory

__addProtocolsDirectory()

Private method to add protocol files of a directory to the project.

#### ProjectProtocolsBrowser.__compileAllProtocols

__compileAllProtocols(grpc=False)

Private method to compile all protocols to Python.

grpc (bool)
  flag indicating to compile as gRPC files

#### ProjectProtocolsBrowser.__compileProto

__compileProto(fn, noDialog=False, progress=None, grpc=False)

Private method to compile a .proto file to Python.

fn (str)
  filename of the .proto file to be compiled
noDialog (bool)
  flag indicating silent operations
progress (E5ProgressDialog)
  reference to the progress dialog
grpc (bool)
  flag indicating to compile as gRPC files

Returns:
  reference to the compile process

Return Type:
  QProcess

#### ProjectProtocolsBrowser.__compileProtoDone

__compileProtoDone(exitCode, exitStatus, grpc)

Private slot to handle the finished signal of the protoc process.

exitCode (int)
  exit code of the process
exitStatus (QProcess.ExitStatus)
  exit status of the process
grpc (bool)
  flag indicating to compile as gRPC files

#### ProjectProtocolsBrowser.__compileProtocol

__compileProtocol(grpc=False)

Private method to compile a protocol to Python.

grpc (bool)
  flag indicating to compile as gRPC files

#### ProjectProtocolsBrowser.__compileSelectedProtocols

__compileSelectedProtocols(grpc=False)

Private method to compile selected protocols to Python.

grpc (bool)
  flag indicating to compile as gRPC files

#### ProjectProtocolsBrowser.__configureProtobuf

__configureProtobuf()

Private method to open the configuration dialog.

#### ProjectProtocolsBrowser.__deleteFile

__deleteFile()

Private method to delete files from the project.

#### ProjectProtocolsBrowser.__getCompilerCommand

__getCompilerCommand(grpc)

Private method to get the compiler command.

grpc (bool)
  flag indicating to get a gRPC command

Returns:
  tuple giving the executable and its parameter list

Return Type:
  tuple of (str, list of str)

#### ProjectProtocolsBrowser.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal of the protoc process.

#### ProjectProtocolsBrowser.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal of the protoc process.

#### ProjectProtocolsBrowser.__showContextMenu

__showContextMenu()

Private slot called by the menu aboutToShow signal.

#### ProjectProtocolsBrowser.__showContextMenuBack

__showContextMenuBack()

Private slot called by the backMenu aboutToShow signal.

#### ProjectProtocolsBrowser.__showContextMenuDir

__showContextMenuDir()

Private slot called by the dirMenu aboutToShow signal.

#### ProjectProtocolsBrowser.__showContextMenuDirMulti

__showContextMenuDirMulti()

Private slot called by the dirMultiMenu aboutToShow signal.

#### ProjectProtocolsBrowser.__showContextMenuMulti

__showContextMenuMulti()

Private slot called by the multiMenu aboutToShow signal.

#### ProjectProtocolsBrowser._contextMenuRequested

_contextMenuRequested(coord)

Protected slot to show the context menu.

coord
  the position of the mouse pointer (QPoint)

#### ProjectProtocolsBrowser._createPopupMenus

_createPopupMenus()

Protected overloaded method to generate the popup menu.

#### ProjectProtocolsBrowser._openItem

_openItem()

Protected slot to handle the open popup menu entry.

Up