1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 def _CommonChecks(input_api
, output_api
):
9 # Importing ui actually brings tvcm into the path.
11 from tvcm
import presubmit_checker
12 checker
= presubmit_checker
.PresubmitChecker(input_api
, output_api
)
13 results
+= checker
.RunChecks()
16 def GetPathsToPrepend(input_api
):
17 return [input_api
.PresubmitLocalPath()]
19 def RunWithPrependedPath(prepended_path
, fn
, *args
):
23 sys
.path
= prepended_path
+ old_path
28 def CheckChangeOnUpload(input_api
, output_api
):
31 results
.extend(_CommonChecks(input_api
, output_api
))
33 return RunWithPrependedPath(GetPathsToPrepend(input_api
), go
)
35 def CheckChangeOnCommit(input_api
, output_api
):
38 results
.extend(_CommonChecks(input_api
, output_api
))
40 return RunWithPrependedPath(GetPathsToPrepend(input_api
), go
)