3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
18 from cmframework.apis import cmerror
21 class CMPluginManager(object):
23 def __init__(self, plugins_path):
26 self.plugins_path = plugins_path
28 # pylint: disable=no-self-use
29 def load_plugin(self):
30 raise cmerror.CMError('Not implemented')
32 # pylint: disable=no-self-use
33 def build_input(self, indata, filtername):
34 search_re = re.compile(filtername)
35 if isinstance(indata, dict):
37 for key, value in indata.iteritems():
38 logging.debug('Matching %s against %s', key, filtername)
39 if search_re.match(key):
40 filter_data[key] = value
44 logging.debug('Matching %s against %s', key, filtername)
45 if search_re.match(key):
46 filter_data.append(key)