Ticket #19441: patch-gtk-builder-convert-2.diff

File patch-gtk-builder-convert-2.diff, 2.0 KB (added by gale@…, 16 years ago)
  • gtk-builder-convert

    old new  
    258258        for node in objects:
    259259            self._convert(node.getAttribute("class"), node)
    260260            if self._get_object(node.getAttribute('id')) is not None:
    261                 print "WARNING: duplicate id \"" + node.getAttribute('id') + "\""
     261                print("WARNING: duplicate id \"" + node.getAttribute('id') + "\"")
    262262            self.objects[node.getAttribute('id')] = node
    263263
    264264        # Convert Gazpachos UI tag
     
    441441            if signal_name in ['activate', 'toggled']:
    442442                action.appendChild(signal)
    443443            else:
    444                 print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
    445                                                    signal_name)
     444                print('Unhandled signal %s::%s' % (node.getAttribute('class'),
     445                                                   signal_name))
    446446
    447447        if not uimgr.childNodes:
    448448            child = self._dom.createElement('child')
     
    461461        for accelerator in get_accelerator_nodes(node):
    462462            signal_name = accelerator.getAttribute('signal')
    463463            if signal_name != 'activate':
    464                 print 'Unhandled accelerator signal for %s::%s' % (
    465                     node.getAttribute('class'), signal_name)
     464                print('Unhandled accelerator signal for %s::%s' % (
     465                    node.getAttribute('class'), signal_name))
    466466                continue
    467467            accelerator.removeAttribute('signal')
    468468            child.appendChild(accelerator)
     
    711711    return s.stdout.read()
    712712
    713713def usage():
    714     print __doc__
     714    print(__doc__)
    715715
    716716def main(args):
    717717    try:
     
    745745
    746746    xml = _indent(conv.to_xml())
    747747    if output_filename == "-":
    748         print xml
     748        print(xml)
    749749    else:
    750750        open(output_filename, 'w').write(xml)
    751         print "Wrote", output_filename
     751        print("Wrote", output_filename)
    752752
    753753    return 0
    754754