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

Unified Diff: chrome/tools/build/win/sort_sln.py

Issue 8680018: Fix python scripts in src/chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 9 years, 1 month 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
« no previous file with comments | « chrome/tools/build/win/sln_deps.py ('k') | chrome/tools/check_grd_for_unused_strings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/win/sort_sln.py
diff --git a/chrome/tools/build/win/sort_sln.py b/chrome/tools/build/win/sort_sln.py
deleted file mode 100755
index ea88ce4a1920560eb0a08590a324db07517f3156..0000000000000000000000000000000000000000
--- a/chrome/tools/build/win/sort_sln.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-
-if len(sys.argv) != 2:
- print """Usage: sort_sln.py <SOLUTIONNAME>.sln
-to sort the solution file to a normalized scheme. Do this before checking in
-changes to a solution file to avoid having a lot of unnecessary diffs."""
- sys.exit(1)
-
-filename = sys.argv[1]
-print "Sorting " + filename;
-
-try:
- sln = open(filename, "r");
-except IOError:
- print "Unable to open " + filename + " for reading."
- sys.exit(1)
-
-output = ""
-seclines = None
-while 1:
- line = sln.readline()
- if not line:
- break
-
- if seclines is not None:
- # Process the end of a section, dump the sorted lines
- if line.lstrip().startswith('End'):
- output = output + ''.join(sorted(seclines))
- seclines = None
- # Process within a section
- else:
- seclines.append(line)
- continue
-
- # Process the start of a section
- if (line.lstrip().startswith('GlobalSection') or
- line.lstrip().startswith('ProjectSection')):
- if seclines: raise Exception('Already in a section')
- seclines = []
-
- output = output + line
-
-sln.close()
-try:
- sln = open(filename, "w")
- sln.write(output)
-except IOError:
- print "Unable to write to " + filename
- sys.exit(1);
-print "Done."
-
« no previous file with comments | « chrome/tools/build/win/sln_deps.py ('k') | chrome/tools/check_grd_for_unused_strings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698