Index: components/policy/resources/PRESUBMIT.py |
diff --git a/chrome/app/policy/PRESUBMIT.py b/components/policy/resources/PRESUBMIT.py |
similarity index 94% |
rename from chrome/app/policy/PRESUBMIT.py |
rename to components/policy/resources/PRESUBMIT.py |
index 91f24c475e8ecab02ca4bb3371e4ad33902a6732..3870875aa379667a0dc5c6d59e95347b8e3934b3 100644 |
--- a/chrome/app/policy/PRESUBMIT.py |
+++ b/components/policy/resources/PRESUBMIT.py |
@@ -26,13 +26,15 @@ def _GetPolicyTemplates(template_path): |
return list(itertools.chain(policies, subpolicies)) |
def _CheckPolicyTemplatesSyntax(input_api, output_api): |
- filepath = input_api.os_path.join(input_api.PresubmitLocalPath(), |
- 'policy_templates.json') |
+ local_path = input_api.PresubmitLocalPath() |
+ filepath = input_api.os_path.join(local_path, 'policy_templates.json') |
if any(f.AbsoluteLocalPath() == filepath |
for f in input_api.AffectedFiles()): |
old_sys_path = sys.path |
try: |
- sys.path = [input_api.PresubmitLocalPath()] + sys.path |
+ tools_path = input_api.os_path.normpath( |
+ input_api.os_path.join(local_path, input_api.os_path.pardir, 'tools')) |
+ sys.path = [ tools_path ] + sys.path |
# Optimization: only load this when it's needed. |
import syntax_check_policy_template_json |
checker = syntax_check_policy_template_json.PolicyTemplateChecker() |