def _write_port(self, io_type, port_name, port_type,
                    lines, doc, optional=False):
        lines.append("    reg.add_%s_port(%s, '%s', \n" % (io_type,
                                                           self._name,
                                                           port_name))
        lines.append("                       ")
        lines.append("(%s,\n" % port_type)
        lines.append("                        ")
        if not optional:
            lines.append("\"%s\"))\n" % doc)
        else:
            lines.append("\"%s\"), True)\n" % doc)
dataset/ETHPy150Open VisTrails/VisTrails/contrib/cdat/scripts/cdat_domain.py/CDATAction._write_port/original