OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (C) 2013 Google Inc. All rights reserved. | 3 # Copyright (C) 2013 Google Inc. All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 parser.error('No arguments allowed, but %d given.' % len(args)) | 75 parser.error('No arguments allowed, but %d given.' % len(args)) |
76 return options | 76 return options |
77 | 77 |
78 | 78 |
79 def write_event_interfaces_file(interfaces_info, destination_filename, only_if_c
hanged): | 79 def write_event_interfaces_file(interfaces_info, destination_filename, only_if_c
hanged): |
80 # Event interfaces are interfaces that inherit from Event, and Event itself | 80 # Event interfaces are interfaces that inherit from Event, and Event itself |
81 event_interfaces = set( | 81 event_interfaces = set( |
82 interface_name | 82 interface_name |
83 for interface_name, interface_info in interfaces_info.iteritems() | 83 for interface_name, interface_info in interfaces_info.iteritems() |
84 if (interface_name == 'Event' or | 84 if (interface_name == 'Event' or |
85 ('ancestors' in interface_info and | 85 (interface_info['ancestors'] and |
86 interface_info['ancestors'][-1] == 'Event'))) | 86 interface_info['ancestors'][-1] == 'Event'))) |
87 | 87 |
88 def extended_attribute_string(name, value): | 88 def extended_attribute_string(name, value): |
89 if name == 'RuntimeEnabled': | 89 if name == 'RuntimeEnabled': |
90 value += 'Enabled' | 90 value += 'Enabled' |
91 return name + '=' + value | 91 return name + '=' + value |
92 | 92 |
93 def interface_line(interface_name): | 93 def interface_line(interface_name): |
94 full_path = interfaces_info[interface_name]['full_path'] | 94 full_path = interfaces_info[interface_name]['full_path'] |
95 | 95 |
(...skipping 25 matching lines...) Expand all Loading... |
121 options = parse_options() | 121 options = parse_options() |
122 with open(options.interfaces_info_file) as interfaces_info_file: | 122 with open(options.interfaces_info_file) as interfaces_info_file: |
123 interfaces_info = pickle.load(interfaces_info_file) | 123 interfaces_info = pickle.load(interfaces_info_file) |
124 write_event_interfaces_file(interfaces_info, | 124 write_event_interfaces_file(interfaces_info, |
125 options.event_interfaces_file, | 125 options.event_interfaces_file, |
126 options.write_file_only_if_changed) | 126 options.write_file_only_if_changed) |
127 | 127 |
128 | 128 |
129 if __name__ == '__main__': | 129 if __name__ == '__main__': |
130 sys.exit(main()) | 130 sys.exit(main()) |
OLD | NEW |