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

Side by Side Diff: gcl.py

Issue 2366002: Fix argument checking in gcl.py (Closed)
Patch Set: Better style Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """\ 6 """\
7 Wrapper script around Rietveld's upload.py that simplifies working with groups 7 Wrapper script around Rietveld's upload.py that simplifies working with groups
8 of files. 8 of files.
9 """ 9 """
10 10
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 return function(change_info) 660 return function(change_info)
661 defer_attributes(function, hook) 661 defer_attributes(function, hook)
662 hook.need_change = True 662 hook.need_change = True
663 hook.no_args = True 663 hook.no_args = True
664 return hook 664 return hook
665 665
666 666
667 def need_change_and_args(function): 667 def need_change_and_args(function):
668 """Converts args -> change_info.""" 668 """Converts args -> change_info."""
669 def hook(args): 669 def hook(args):
670 if not args:
671 ErrorExit("You need to pass a change list name")
670 change_info = ChangeInfo.Load(args.pop(0), GetRepositoryRoot(), True, True) 672 change_info = ChangeInfo.Load(args.pop(0), GetRepositoryRoot(), True, True)
671 return function(change_info, args) 673 return function(change_info, args)
672 defer_attributes(function, hook) 674 defer_attributes(function, hook)
673 hook.need_change = True 675 hook.need_change = True
674 return hook 676 return hook
675 677
676 678
677 def no_args(function): 679 def no_args(function):
678 """Make sure no args are passed.""" 680 """Make sure no args are passed."""
679 def hook(args): 681 def hook(args):
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 argv = ['help'] 1310 argv = ['help']
1309 command = Command(argv[0]) 1311 command = Command(argv[0])
1310 if command: 1312 if command:
1311 return command(argv[1:]) 1313 return command(argv[1:])
1312 # Unknown command, try to pass that to svn 1314 # Unknown command, try to pass that to svn
1313 return CMDpassthru(argv) 1315 return CMDpassthru(argv)
1314 1316
1315 1317
1316 if __name__ == "__main__": 1318 if __name__ == "__main__":
1317 sys.exit(main(sys.argv[1:])) 1319 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698