VirtualBox

Ignore:
Timestamp:
Sep 22, 2016 7:58:05 AM (8 years ago)
Author:
vboxsync
Message:

Build/scripts (bugref:6627): Python build scripts updated to generate the same code when used with Python 2 and 3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/get_components.py

    r50041 r63939  
    33#
    44# See the file LICENSE.txt for information on redistributing this software.
     5
     6from __future__ import print_function
    57
    68num_components = {
     
    114116}
    115117
    116 print """unsigned int crStateHlpComponentsCount( GLenum pname )
     118print("""unsigned int crStateHlpComponentsCount( GLenum pname )
    117119{
    118120        switch( pname )
    119121        {
    120 """
    121 comps = num_components.keys();
    122 comps.sort();
    123 for comp in comps:
    124         print '\t\t\tcase %s: return %d;' % (comp,num_components[comp])
     122""")
     123for comp in sorted(num_components.keys()):
     124        print('\t\t\tcase %s: return %d;' % (comp,num_components[comp]))
    125125
    126 comps = num_extended_components.keys();
    127 comps.sort();
    128 for comp in comps:
     126for comp in sorted(num_extended_components.keys()):
    129127        (nc, ifdef) = num_extended_components[comp]
    130         print '#ifdef %s' % ifdef
    131         print '\t\t\tcase %s: return %d;' % (comp,nc)
    132         print '#endif /* %s */' % ifdef
     128        print('#ifdef %s' % ifdef)
     129        print('\t\t\tcase %s: return %d;' % (comp,nc))
     130        print('#endif /* %s */' % ifdef)
    133131
    134 print """
     132print("""
    135133                default:
    136134                        crError( "Unknown parameter name in crStateHlpComponentsCount: %d", (int) pname );
     
    140138        return 0;
    141139}
    142 """
     140""")
    143141
    144142
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette