def parseRequest_pty_req(data):
 (term, rest) = common.getNS(data)
 (cols, rows, xpixel, ypixel) = struct.unpack('>4L', rest[:16])
 (modes, ignored) = common.getNS(rest[16:])
 winSize = (rows, cols, xpixel, ypixel)
 modes = [(ord(modes[i:(i + 1)]), struct.unpack('>L', modes[(i + 1):(i + 5)])[0]) for i in range(0, (len(modes) - 1), 5)]
 return (term, winSize, modes)

def parseRequest_pty_req ( data ) : ( term , rest ) = common . getNS ( data ) ( cols , rows , xpixel , ypixel ) = struct . unpack ( '>4L' , rest [ : 16 ] ) ( modes , ignored ) = common . getNS ( rest [ 16 : ] ) winSize = ( rows , cols , xpixel , ypixel ) modes = [ ( ord ( modes [ i : ( i + 1 ) ] ) , struct . unpack ( '>L' , modes [ ( i + 1 ) : ( i + 5 ) ] ) [ 0 ] ) for i in range ( 0 , ( len ( modes ) - 1 ) , 5 ) ] return ( term , winSize , modes )
parse the data from a pty-req request into usable data .