changeset 52125:1938d72e7a16

wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 24 Oct 2024 20:50:47 -0400
parents 47981c4bfeee
children e7812caacc3c
files mercurial/wireprotoserver.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireprotoserver.py	Thu Oct 24 20:47:12 2024 -0400
+++ b/mercurial/wireprotoserver.py	Thu Oct 24 20:50:47 2024 -0400
@@ -19,7 +19,6 @@
     wireprototypes,
     wireprotov1server,
 )
-from .interfaces import util as interfaceutil
 from .utils import (
     compression,
     stringutil,
@@ -56,8 +55,7 @@
     return b''.join(chunks)
 
 
-@interfaceutil.implementer(wireprototypes.baseprotocolhandler)
-class httpv1protocolhandler:
+class httpv1protocolhandler(wireprototypes.baseprotocolhandler):
     def __init__(self, req, ui, checkperm):
         self._req = req
         self._ui = ui
@@ -65,7 +63,7 @@
         self._protocaps = None
 
     @property
-    def name(self):
+    def name(self) -> bytes:
         return b'http-v1'
 
     def getargs(self, args):
@@ -375,8 +373,7 @@
     fout.flush()
 
 
-@interfaceutil.implementer(wireprototypes.baseprotocolhandler)
-class sshv1protocolhandler:
+class sshv1protocolhandler(wireprototypes.baseprotocolhandler):
     """Handler for requests services via version 1 of SSH protocol."""
 
     def __init__(self, ui, fin, fout):
@@ -386,7 +383,7 @@
         self._protocaps = set()
 
     @property
-    def name(self):
+    def name(self) -> bytes:
         return wireprototypes.SSHV1
 
     def getargs(self, args):