##// END OF EJS Templates
wireprototypes: make `baseprotocolhandler` methods abstract...
Matt Harbison -
r53020:fd200f5b default
parent child Browse files
Show More
@@ -202,6 +202,7 class baseprotocolhandler(Protocol):
202 Used for uniquely identifying the transport type.
202 Used for uniquely identifying the transport type.
203 """
203 """
204
204
205 @abc.abstractmethod
205 def getargs(self, args):
206 def getargs(self, args):
206 """return the value for arguments in <args>
207 """return the value for arguments in <args>
207
208
@@ -210,12 +211,14 class baseprotocolhandler(Protocol):
210 a dict mapping argument name to value.
211 a dict mapping argument name to value.
211 """
212 """
212
213
214 @abc.abstractmethod
213 def getprotocaps(self):
215 def getprotocaps(self):
214 """Returns the list of protocol-level capabilities of client
216 """Returns the list of protocol-level capabilities of client
215
217
216 Returns a list of capabilities as declared by the client for
218 Returns a list of capabilities as declared by the client for
217 the current request (or connection for stateful protocol handlers)."""
219 the current request (or connection for stateful protocol handlers)."""
218
220
221 @abc.abstractmethod
219 def getpayload(self):
222 def getpayload(self):
220 """Provide a generator for the raw payload.
223 """Provide a generator for the raw payload.
221
224
@@ -223,6 +226,7 class baseprotocolhandler(Protocol):
223 processed.
226 processed.
224 """
227 """
225
228
229 @abc.abstractmethod
226 def mayberedirectstdio(self):
230 def mayberedirectstdio(self):
227 """Context manager to possibly redirect stdio.
231 """Context manager to possibly redirect stdio.
228
232
@@ -236,9 +240,11 class baseprotocolhandler(Protocol):
236 won't be captured.
240 won't be captured.
237 """
241 """
238
242
243 @abc.abstractmethod
239 def client(self):
244 def client(self):
240 """Returns a string representation of this client (as bytes)."""
245 """Returns a string representation of this client (as bytes)."""
241
246
247 @abc.abstractmethod
242 def addcapabilities(self, repo, caps):
248 def addcapabilities(self, repo, caps):
243 """Adds advertised capabilities specific to this protocol.
249 """Adds advertised capabilities specific to this protocol.
244
250
@@ -247,6 +253,7 class baseprotocolhandler(Protocol):
247 Returns a list of capabilities. The passed in argument can be returned.
253 Returns a list of capabilities. The passed in argument can be returned.
248 """
254 """
249
255
256 @abc.abstractmethod
250 def checkperm(self, perm):
257 def checkperm(self, perm):
251 """Validate that the client has permissions to perform a request.
258 """Validate that the client has permissions to perform a request.
252
259
General Comments 0
You need to be logged in to leave comments. Login now