Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: tools/pretty_vcproj.py

Issue 523164: License cleanup for http://code.google.com/p/gyp/issues/detail?id=133... (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« test/toolsets/toolsets.cc ('K') | « tools/pretty_sln.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/pretty_vcproj.py
===================================================================
--- tools/pretty_vcproj.py (revision 770)
+++ tools/pretty_vcproj.py (working copy)
@@ -1,12 +1,14 @@
#!/usr/bin/python2.5
-# Copyright 2009 Google Inc.
-# All Rights Reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked vsprops and include them explicitly in the vcproj.
-
+
It outputs the resulting xml to stdout.
"""
@@ -146,13 +148,13 @@
sub_node.data = sub_node.data.replace("\r", "")
sub_node.data = sub_node.data.replace("\n", "")
sub_node.data = sub_node.data.rstrip()
-
+
# Fix all the semicolon separated attributes to be sorted, and we also
# remove the dups.
if node.attributes:
for (name, value) in node.attributes.items():
sorted_list = sorted(value.split(';'))
- unique_list = []
+ unique_list = []
[unique_list.append(i) for i in sorted_list if not unique_list.count(i)]
node.setAttribute(name, ';'.join(unique_list))
if not value:
@@ -160,7 +162,7 @@
if node.childNodes:
node.normalize()
-
+
# For each node, take a copy, and remove it from the list.
node_array = []
while node.childNodes and node.childNodes[0]:
@@ -175,7 +177,7 @@
else:
node_array.append(current)
-
+
# Sort the list.
node_array.sort(CmpNode())
@@ -309,6 +311,6 @@
# user.
#print dom.toprettyxml(newl="\n")
PrettyPrintNode(dom.documentElement)
-
+
if __name__ == '__main__':
- main(sys.argv)
+ main(sys.argv)
« test/toolsets/toolsets.cc ('K') | « tools/pretty_sln.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698