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 258 258 for node in objects: 259 259 self._convert(node.getAttribute("class"), node) 260 260 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') + "\"") 262 262 self.objects[node.getAttribute('id')] = node 263 263 264 264 # Convert Gazpachos UI tag … … 441 441 if signal_name in ['activate', 'toggled']: 442 442 action.appendChild(signal) 443 443 else: 444 print 445 signal_name) 444 print('Unhandled signal %s::%s' % (node.getAttribute('class'), 445 signal_name)) 446 446 447 447 if not uimgr.childNodes: 448 448 child = self._dom.createElement('child') … … 461 461 for accelerator in get_accelerator_nodes(node): 462 462 signal_name = accelerator.getAttribute('signal') 463 463 if signal_name != 'activate': 464 print 465 node.getAttribute('class'), signal_name) 464 print('Unhandled accelerator signal for %s::%s' % ( 465 node.getAttribute('class'), signal_name)) 466 466 continue 467 467 accelerator.removeAttribute('signal') 468 468 child.appendChild(accelerator) … … 711 711 return s.stdout.read() 712 712 713 713 def usage(): 714 print __doc__714 print(__doc__) 715 715 716 716 def main(args): 717 717 try: … … 745 745 746 746 xml = _indent(conv.to_xml()) 747 747 if output_filename == "-": 748 print xml748 print(xml) 749 749 else: 750 750 open(output_filename, 'w').write(xml) 751 print "Wrote", output_filename751 print("Wrote", output_filename) 752 752 753 753 return 0 754 754