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

Side by Side Diff: ceee/PRESUBMIT.py

Issue 6299001: Syntax checker for policy_templates.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/app/policy
Patch Set: address even more comments Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/app/policy/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os
6 import sys 5 import sys
7 6
8 7
9 def CheckChange(input_api, output_api, committing): 8 def CheckChange(input_api, output_api, committing):
10 # We need to change the path so that we can import ceee_presubmit 9 # We need to change the path so that we can import ceee_presubmit
11 # which lies at the root of the ceee folder. And we do it here so that 10 # which lies at the root of the ceee folder. And we do it here so that
12 # it doesn't pollute all the cases where we get imported yet not called. 11 # it doesn't pollute all the cases where we get imported yet not called.
13 sys.path.append(os.path.join(input_api.PresubmitLocalPath(), '../ceee')) 12 old_sys_path = sys.path
14 import ceee_presubmit 13 ceee_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '../ceee')
15 return ceee_presubmit.CheckChange(input_api, 14 try:
16 output_api, 15 sys.path = [ceee_path] + sys.path
17 committing) 16 import ceee_presubmit
17 return ceee_presubmit.CheckChange(input_api,
M-A Ruel 2011/01/18 16:38:14 nit: this line fits 80 cols so no need to split it
Jakob Kummerow 2011/01/19 10:06:33 Done.
18 output_api,
19 committing)
20 finally:
21 sys.path = old_sys_path
18 22
19 23
20 def CheckChangeOnUpload(input_api, output_api): 24 def CheckChangeOnUpload(input_api, output_api):
21 return CheckChange(input_api, output_api, False) 25 return CheckChange(input_api, output_api, False)
22 26
23 27
24 def CheckChangeOnCommit(input_api, output_api): 28 def CheckChangeOnCommit(input_api, output_api):
25 return CheckChange(input_api, output_api, True) 29 return CheckChange(input_api, output_api, True)
OLDNEW
« no previous file with comments | « no previous file | chrome/app/policy/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698