##// END OF EJS Templates
wireprotoserver: make abstractserverproto a proper abstract base class...
Gregory Szorc -
r35890:68dc621f default
parent child Browse files
Show More
@@ -6,6 +6,7 b''
6
6
7 from __future__ import absolute_import
7 from __future__ import absolute_import
8
8
9 import abc
9 import cgi
10 import cgi
10 import struct
11 import struct
11 import sys
12 import sys
@@ -37,12 +38,15 b' class abstractserverproto(object):'
37 Used as reference and documentation.
38 Used as reference and documentation.
38 """
39 """
39
40
41 __metaclass__ = abc.ABCMeta
42
43 @abc.abstractmethod
40 def getargs(self, args):
44 def getargs(self, args):
41 """return the value for arguments in <args>
45 """return the value for arguments in <args>
42
46
43 returns a list of values (same order as <args>)"""
47 returns a list of values (same order as <args>)"""
44 raise NotImplementedError()
45
48
49 @abc.abstractmethod
46 def getfile(self, fp):
50 def getfile(self, fp):
47 """write the whole content of a file into a file like object
51 """write the whole content of a file into a file like object
48
52
@@ -52,13 +56,12 b' class abstractserverproto(object):'
52
56
53 chunk size is the ascii version of the int.
57 chunk size is the ascii version of the int.
54 """
58 """
55 raise NotImplementedError()
56
59
60 @abc.abstractmethod
57 def redirect(self):
61 def redirect(self):
58 """may setup interception for stdout and stderr
62 """may setup interception for stdout and stderr
59
63
60 See also the `restore` method."""
64 See also the `restore` method."""
61 raise NotImplementedError()
62
65
63 # If the `redirect` function does install interception, the `restore`
66 # If the `redirect` function does install interception, the `restore`
64 # function MUST be defined. If interception is not used, this function
67 # function MUST be defined. If interception is not used, this function
General Comments 0
You need to be logged in to leave comments. Login now