1 # Copyright 2015 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. 4 import os 5 6 def CheckChange(input_api, output_api): 7 init_py_path = os.path.join(input_api.PresubmitLocalPath(), '__init__.py') 8 res = [] 9 if os.path.exists(init_py_path): 10 res += [output_api.PresubmitError( 11 '__init__.py is not allowed to exist in bin/')] 12 return res 13 14 def CheckChangeOnUpload(input_api, output_api): 15 return CheckChange(input_api, output_api) 16 17 18 def CheckChangeOnCommit(input_api, output_api): 19 return CheckChange(input_api, output_api) 20