(self, buff)
return None
Write is called by Curl()
Write is called by Curl()
Write is called by Curl ()
def write(self, buff):
        """Write is called by Curl()"""
        if not isinstance(buff, str):
            buff = buff.decode()
        pair = buff.split(":", 1)
        if len(pair) == 2:
            key = pair[0].strip().lower()
            if key:
                self.data[key] = pair[1].strip()
        elif pair[0].startswith("HTTP/"):
            self.data["X-ND-HTTPSTATUS"] = buff.strip()
        elif (self.sizeonly and
              pair[0].strip() == "" and
              "location" not in self.data):
            return -1
        return None
def write ( self , buff ) : if not isinstance ( buff , str ) : buff = buff . decode ( ) pair = buff . split ( ":" , 1 ) if len ( pair ) == 2 : key = pair [ 0 ] . strip ( ) . lower ( ) if key : self . data [ key ] = pair [ 1 ] . strip ( ) elif pair [ 0 ] . startswith ( "HTTP/" ) : self . data [ "X-ND-HTTPSTATUS" ] = buff . strip ( ) elif ( self . sizeonly and pair [ 0 ] . strip ( ) == "" and "location" not in self . data ) : return - 1 return None