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

Unified Diff: chrome/browser/resources/file_manager/bin/squashdir.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/browser/chromeos/input_method/litify_proto_file.py ('k') | chrome/browser/sync/PRESUBMIT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/bin/squashdir.py
diff --git a/chrome/browser/resources/file_manager/bin/squashdir.py b/chrome/browser/resources/file_manager/bin/squashdir.py
index e523a91660a62f2af4bc1aa9ca1ccdd3561ad1b8..408f526d4418a1d5b4d0ccce0c9c49a51bb0e2a3 100755
--- a/chrome/browser/resources/file_manager/bin/squashdir.py
+++ b/chrome/browser/resources/file_manager/bin/squashdir.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2011 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.
@@ -27,9 +27,11 @@ presented by <input type=file multiple> do not allow users to recurse a
selected directory, nor do they provide information about directory structure.
""")
+
def status(msg):
sys.stderr.write(msg + '\n')
+
def scan_path(dest, src, path):
abs_src = os.path.join(src, path)
statinfo = os.stat(abs_src)
@@ -44,10 +46,11 @@ def scan_path(dest, src, path):
for child_path in glob.glob(abs_src + '/*'):
scan_path(dest, src, child_path[len(src) + 1:])
-if __name__ == '__main__':
+
+def main():
if len(sys.argv) < 3 or sys.argv[1][0] == '-':
usage()
- return
+ return 1
dest = sys.argv[1]
for src in sys.argv[2:]:
@@ -55,3 +58,8 @@ if __name__ == '__main__':
path = os.path.basename(abs_src)
abs_src = os.path.dirname(abs_src)
scan_path(dest, abs_src, path)
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« no previous file with comments | « chrome/browser/chromeos/input_method/litify_proto_file.py ('k') | chrome/browser/sync/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698