src/eric7/RemoteServerInterface/EricServerInterface.py

branch
server
changeset 10774
7f7ff7456904
parent 10771
69dfb1339451
child 10775
fd8b7692c03d
equal deleted inserted replaced
10773:b2e75ba58a30 10774:7f7ff7456904
44 of a remote server code coverage request 44 of a remote server code coverage request
45 @signal remoteDebuggerReply(request:str, params:dict) emitted to deliver the reply 45 @signal remoteDebuggerReply(request:str, params:dict) emitted to deliver the reply
46 of a remote server debugger request 46 of a remote server debugger request
47 @signal remoteEchoReply(request:str, params:dict) emitted to deliver the reply of 47 @signal remoteEchoReply(request:str, params:dict) emitted to deliver the reply of
48 a remote server echo request 48 a remote server echo request
49 @signal remoteEditorConfig(request:str, params:dict) emitted to deliver the reply
50 of a remote server editor config request
49 @signal remoteFileSystemReply(request:str, params:dict) emitted to deliver the 51 @signal remoteFileSystemReply(request:str, params:dict) emitted to deliver the
50 reply of a remote server file system request 52 reply of a remote server file system request
51 @signal remoteProjectReply(request:str, params:dict) emitted to deliver the reply 53 @signal remoteProjectReply(request:str, params:dict) emitted to deliver the reply
52 of a remote server project related request 54 of a remote server project related request
53 @signal remoteServerReply(request:str, params:dict) emitted to deliver the reply 55 @signal remoteServerReply(request:str, params:dict) emitted to deliver the reply
62 remoteReply = pyqtSignal(int, str, dict) 64 remoteReply = pyqtSignal(int, str, dict)
63 65
64 remoteCoverageReply = pyqtSignal(str, dict) 66 remoteCoverageReply = pyqtSignal(str, dict)
65 remoteDebuggerReply = pyqtSignal(str, dict) 67 remoteDebuggerReply = pyqtSignal(str, dict)
66 remoteEchoReply = pyqtSignal(str, dict) 68 remoteEchoReply = pyqtSignal(str, dict)
69 remoteEditorConfig = pyqtSignal(str, dict)
67 remoteFileSystemReply = pyqtSignal(str, dict) 70 remoteFileSystemReply = pyqtSignal(str, dict)
68 remoteProjectReply = pyqtSignal(str, dict) 71 remoteProjectReply = pyqtSignal(str, dict)
69 remoteServerReply = pyqtSignal(str, dict) 72 remoteServerReply = pyqtSignal(str, dict)
70 73
71 def __init__(self, parent=None): 74 def __init__(self, parent=None):
81 84
82 self.__categorySignalMapping = { 85 self.__categorySignalMapping = {
83 EricRequestCategory.Coverage: self.remoteCoverageReply, 86 EricRequestCategory.Coverage: self.remoteCoverageReply,
84 EricRequestCategory.Debugger: self.remoteDebuggerReply, 87 EricRequestCategory.Debugger: self.remoteDebuggerReply,
85 EricRequestCategory.Echo: self.remoteEchoReply, 88 EricRequestCategory.Echo: self.remoteEchoReply,
89 EricRequestCategory.EditorConfig: self.remoteEditorConfig,
86 EricRequestCategory.FileSystem: self.remoteFileSystemReply, 90 EricRequestCategory.FileSystem: self.remoteFileSystemReply,
87 EricRequestCategory.Project: self.remoteProjectReply, 91 EricRequestCategory.Project: self.remoteProjectReply,
88 EricRequestCategory.Server: self.remoteServerReply, 92 EricRequestCategory.Server: self.remoteServerReply,
89 } 93 }
90 self.__serviceInterfaces = {} 94 self.__serviceInterfaces = {}
111 """ 115 """
112 lname = name.lower() 116 lname = name.lower()
113 try: 117 try:
114 return self.__serviceInterfaces[lname] 118 return self.__serviceInterfaces[lname]
115 except KeyError: 119 except KeyError:
116 if lname not in ("coverage", "debugger", "filesystem"): 120 if lname not in ("coverage", "debugger", "editorconfig", "filesystem"):
117 raise ValueError(f"no such service supported ({name})") 121 raise ValueError(f"no such service supported ({name})")
118 else: 122 else:
119 # instantiate the service interface 123 # instantiate the service interface
120 if lname == "filesystem": 124 if lname == "filesystem":
121 from .EricServerFileSystemInterface import ( # noqa: I101 125 from .EricServerFileSystemInterface import ( # noqa: I101
135 from .EricServerCoverageInterface import ( # noqa: I101 139 from .EricServerCoverageInterface import ( # noqa: I101
136 EricServerCoverageInterface, 140 EricServerCoverageInterface,
137 ) 141 )
138 142
139 self.__serviceInterfaces[lname] = EricServerCoverageInterface(self) 143 self.__serviceInterfaces[lname] = EricServerCoverageInterface(self)
144 elif lname == "editorconfig":
145 from .EricServerEditorConfigInterface import ( # noqa: I101
146 EricServerEditorConfigInterface
147 )
148
149 self.__serviceInterfaces[lname] = EricServerEditorConfigInterface(
150 self
151 )
140 152
141 return self.__serviceInterfaces[lname] 153 return self.__serviceInterfaces[lname]
142 154
143 ####################################################################### 155 #######################################################################
144 ## Methods for handling the server connection. 156 ## Methods for handling the server connection.
618 menu = QMenu(self.tr("eric-ide Server"), self.__ui) 630 menu = QMenu(self.tr("eric-ide Server"), self.__ui)
619 menu.setTearOffEnabled(True) 631 menu.setTearOffEnabled(True)
620 menu.aboutToShow.connect(self.__showEricServerMenu) 632 menu.aboutToShow.connect(self.__showEricServerMenu)
621 menu.addAction(self.connectServerAct) 633 menu.addAction(self.connectServerAct)
622 menu.addMenu(self.__serverProfilesMenu) 634 menu.addMenu(self.__serverProfilesMenu)
623 # TODO: add a 'Recent Connections' submenu
624 menu.addSeparator() 635 menu.addSeparator()
625 menu.addAction(self.disconnectServerAct) 636 menu.addAction(self.disconnectServerAct)
626 menu.addSeparator() 637 menu.addSeparator()
627 menu.addAction(self.stopServerAct) 638 menu.addAction(self.stopServerAct)
628 menu.addSeparator() 639 menu.addSeparator()

eric ide

mercurial