示例#1
0
 def __str__(self):
     from hci import console
     from hci import colors
     lineWidth = 90
     representation = colors.colorMap['bright_red'] + 'Name: ' + colors.colorMap['none'] + colors.colorMap['cyan'] + self.name + colors.colorMap['none']
     representation += colors.colorMap['bright_red'] + ' Return value type: ' + colors.colorMap['none'] + colors.colorMap['cyan'] + str(self.retTypeName) + colors.colorMap['none']
     if len(self.path) > 0:
         representation += colors.colorMap['bright_red'] + ' Path: ' + colors.colorMap['none'] + colors.colorMap['cyan'] + str(self.path) + colors.colorMap['none'] + ' '
     else:
         representation += ' '
     return console.go_new_line(representation, lineWidth, 3)
示例#2
0
    def __str__(self):
        """Returns an informal string representation of this class"""
        from hci import console
        from hci import colors
        lineWidth = 90
        if self.module and self.classs:
            representation = console.go_new_line('\t' + colors.colorMap['bright_green'] + '** '+ self.module.__name__ + '.' + self.classs.__name__ + colors.colorMap['none']+':', lineWidth) + '\n\t\t'
            representation += console.go_new_line(console.clean_docstr(self.classs.__doc__ or 'no doc found...'), lineWidth) + '\n\t\t'
            representation += 'Constructor: ' + str(self.constructor) + '\n\t\t'
            in_tlm_portsStr = ''
            for i in self.in_tlm_ports:
                in_tlm_portsStr += '\n\t\t\t' + str(i)
            representation += 'Input TLM ports: ' + in_tlm_portsStr + '\n\t\t'
            out_tlm_portsStr = ''
            for i in self.out_tlm_ports:
                out_tlm_portsStr += '\n\t\t\t' + str(i)
            representation += 'Output TLM ports: ' + out_tlm_portsStr + '\n\t\t'
            in_sysc_portsStr = ''
            for i in self.in_sysc_ports:
                in_sysc_portsStr += '\n\t\t\t' + str(i)
            representation += 'Input SystemC ports: ' + in_sysc_portsStr + '\n\t\t'
            out_sysc_portsStr = ''
            for i in self.out_sysc_ports:
                out_sysc_portsStr += '\n\t\t\t' + str(i)
            representation += 'Output SystemC ports: ' + out_sysc_portsStr + '\n\t\t'
            inout_sysc_portsStr = ''
            for i in self.inout_sysc_ports:
                inout_sysc_portsStr += '\n\t\t\t' + str(i)
            representation += 'InOut SystemC ports: ' + inout_sysc_portsStr + '\n\t\t'
            sysc_signalsStr = ''
            for i in self.sysc_signals:
                sysc_signalsStr += '\n\t\t\t' + str(i)
            representation += 'SystemC signals: ' + sysc_signalsStr + '\n\t\t'

            in_tlm_port_gensStr = ''
            for i in self.in_tlm_port_gens:
                in_tlm_port_gensStr += '\n\t\t\t' + str(i)
            representation += 'Input TLM ports generators: ' + in_tlm_port_gensStr + '\n\t\t'
            out_tlm_ports_gensStr = ''
            for i in self.out_tlm_port_gens:
                out_tlm_ports_genStr += '\n\t\t\t' + str(i)
            representation += 'Output TLM ports generators: ' + out_tlm_ports_gensStr + '\n\t\t'
            in_sysc_ports_gensStr = ''
            for i in self.in_sysc_port_gens:
                in_sysc_ports_genStr += '\n\t\t\t' + str(i)
            representation += 'Input SystemC ports generators: ' + in_sysc_ports_gensStr + '\n\t\t'
            out_sysc_ports_gensStr = ''
            for i in self.out_sysc_port_gens:
                out_sysc_ports_genStr += '\n\t\t\t' + str(i)
            representation += 'Output SystemC ports generators: ' + out_sysc_ports_gensStr + '\n\t\t'
            inout_sysc_port_gensStr = ''
            for i in self.inout_sysc_port_gens:
                inout_sysc_port_gensStr += '\n\t\t\t' + str(i)
            representation += 'InOut SystemC ports generators: ' + inout_sysc_port_gensStr + '\n\t\t'
            sysc_signal_gensStr = ''
            for i in self.sysc_signal_gens:
                sysc_signal_gensStr += '\n\t\t\t' + str(i)
            representation += 'SystemC signals generators: ' + sysc_signal_gensStr

            return representation
        else:
            return ''