mirrored from https://chromium.googlesource.com/infra/luci/recipes-py
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathapi.py
35 lines (28 loc) · 957 Bytes
/
api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Wrapper for CV API."""
from recipe_engine import recipe_api
_INPUT_PROPERTY_KEYS = (
'active',
'dry_run',
'experimental',
'top_level',
'run_mode',
'owner_is_googler',
)
class CQApi(recipe_api.RecipeApi):
"""This module is a thin wrapper of the cv module."""
def __init__(self, props, *args, **kwargs):
super().__init__(*args, **kwargs)
self._input = props
def initialize(self):
"""Apply non-default value cq module properties to the cv module."""
for name in _INPUT_PROPERTY_KEYS:
value = getattr(self._input, name)
if value:
setattr(self.m.cv._input, name, value)
self.m.cv.initialize()
def __getattr__(self, name):
self.m.warning.issue('CQ_MODULE_DEPRECATED')
return getattr(self.m.cv, name)