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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 return '%s %s\n' % (relative_path_posix, | 106 return '%s %s\n' % (relative_path_posix, |
107 ', '.join(extended_attributes_list)) | 107 ', '.join(extended_attributes_list)) |
108 | 108 |
109 lines = ['namespace="Event"\n', | 109 lines = ['namespace="Event"\n', |
110 '\n'] | 110 '\n'] |
111 interface_lines = [interface_line(interface_name) | 111 interface_lines = [interface_line(interface_name) |
112 for interface_name in event_interfaces] | 112 for interface_name in event_interfaces] |
113 interface_lines.sort() | 113 interface_lines.sort() |
114 lines.extend(interface_lines) | 114 lines.extend(interface_lines) |
115 write_file(lines, destination_filename, only_if_changed) | 115 write_file(''.join(lines), destination_filename, only_if_changed) |
116 | 116 |
117 | 117 |
118 ################################################################################ | 118 ################################################################################ |
119 | 119 |
120 def main(): | 120 def main(): |
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 |