def _convert_pflags(self, pflags):
if (pflags & SFTP_FLAG_READ) and (pflags & SFTP_FLAG_WRITE):<EOL><INDENT>flags = os.O_RDWR<EOL><DEDENT>elif pflags & SFTP_FLAG_WRITE:<EOL><INDENT>flags = os.O_WRONLY<EOL><DEDENT>else:<EOL><INDENT>flags = os.O_RDONLY<EOL><DEDENT>if pflags & SFTP_FLAG_APPEND:<EOL><INDENT>flags |= os.O_APPEND<EOL><DEDENT>if pflags & SFTP_FLAG_CREATE:<EOL><INDENT>flags |= os.O_CREAT<EOL><DEDENT>if pflags & SFTP_FLAG_TRUNC:<EOL><INDENT>flags |= os.O_TRUNC<EOL><DEDENT>if pflags & SFTP_FLAG_EXCL:<EOL><INDENT>flags |= os.O_EXCL<EOL><DEDENT>return flags<EOL>
convert SFTP-style open() flags to python's os.open() flags