@@ -36,7 +36,7 @@ class AsyncPipe(Thread):
3636 from an internal thread. Used to process in real time scons output to
3737 show its progress."""
3838
39- def __init__ (self , line_callback = None ):
39+ def __init__ (self , line_callback = None ) -> None :
4040 """If line_callback is not None, it is called for each line as
4141 line_callback(line:str, terminator:str) where line is the line content
4242 and terminator is one of:
@@ -54,28 +54,28 @@ def __init__(self, line_callback=None):
5454 self ._fd_read , self ._fd_write = os .pipe ()
5555
5656 # -- A list of lines received so far.
57- self ._lines_buffer = []
57+ self ._lines_buffer : List [ str ] = []
5858
5959 self .start ()
6060
61- def get_buffer (self ):
61+ def get_buffer (self ) -> List [ str ] :
6262 """DOC: TODO"""
6363
6464 return self ._lines_buffer
6565
66- def fileno (self ):
66+ def fileno (self ) -> int :
6767 """DOC: TODO"""
6868
6969 return self ._fd_write
7070
71- def _handle_incoming_line (self , bfr : bytearray , terminator : str ):
71+ def _handle_incoming_line (self , bfr : bytearray , terminator : str ) -> None :
7272 """Handle a new incoming line.
7373 Bfr is a bytes with the line's content, possibly empty.
7474 See __init__ for the description of terminator.
7575 """
7676 # -- Convert the line's bytes to a string. Replace invalid utf-8
7777 # -- chars with "�"
78- line = bfr .decode ("utf-8" , errors = "replace" )
78+ line : str = bfr .decode ("utf-8" , errors = "replace" )
7979
8080 # -- Append to the lines log buffer.
8181 self ._lines_buffer .append (line )
@@ -84,7 +84,7 @@ def _handle_incoming_line(self, bfr: bytearray, terminator: str):
8484 if self .outcallback :
8585 self .outcallback (line , terminator )
8686
87- def run (self ):
87+ def run (self ) -> None :
8888 """DOC: TODO"""
8989
9090 # -- Prepare a buffer for collecting the line chars, excluding
0 commit comments