##// END OF EJS Templates
wireprotoserver: make name part of protocol interface...
Gregory Szorc -
r35891:29759c46 default
parent child Browse files
Show More
@@ -40,6 +40,13 class abstractserverproto(object):
40
40
41 __metaclass__ = abc.ABCMeta
41 __metaclass__ = abc.ABCMeta
42
42
43 @abc.abstractproperty
44 def name(self):
45 """The name of the protocol implementation.
46
47 Used for uniquely identifying the transport type.
48 """
49
43 @abc.abstractmethod
50 @abc.abstractmethod
44 def getargs(self, args):
51 def getargs(self, args):
45 """return the value for arguments in <args>
52 """return the value for arguments in <args>
@@ -95,7 +102,10 class webproto(abstractserverproto):
95 def __init__(self, req, ui):
102 def __init__(self, req, ui):
96 self._req = req
103 self._req = req
97 self._ui = ui
104 self._ui = ui
98 self.name = 'http'
105
106 @property
107 def name(self):
108 return 'http'
99
109
100 def getargs(self, args):
110 def getargs(self, args):
101 knownargs = self._args()
111 knownargs = self._args()
@@ -255,7 +265,6 class sshserver(abstractserverproto):
255 self._repo = repo
265 self._repo = repo
256 self._fin = ui.fin
266 self._fin = ui.fin
257 self._fout = ui.fout
267 self._fout = ui.fout
258 self.name = 'ssh'
259
268
260 hook.redirect(True)
269 hook.redirect(True)
261 ui.fout = repo.ui.fout = ui.ferr
270 ui.fout = repo.ui.fout = ui.ferr
@@ -264,6 +273,10 class sshserver(abstractserverproto):
264 util.setbinary(self._fin)
273 util.setbinary(self._fin)
265 util.setbinary(self._fout)
274 util.setbinary(self._fout)
266
275
276 @property
277 def name(self):
278 return 'ssh'
279
267 def getargs(self, args):
280 def getargs(self, args):
268 data = {}
281 data = {}
269 keys = args.split()
282 keys = args.split()
General Comments 0
You need to be logged in to leave comments. Login now