mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 18:21:14 +00:00
e0e4f389b9
All config now uses configuration points Config parsing is now done in destinct stages - first all files are parsed and sent to their corresponding config objects or to a tree - tree is traversed to generate job specs.
56 lines
1.6 KiB
Python
56 lines
1.6 KiB
Python
# Copyright 2016 ARM Limited
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
|
class PluginCache(object):
|
|
|
|
def __init__(self):
|
|
self.plugin_configs = {}
|
|
self.device_config = OrderedDict()
|
|
self.source_list = []
|
|
self.finalised = False
|
|
# TODO: Build dics of global_alias: [list of destinations]
|
|
|
|
def add_source(self, source):
|
|
if source in self.source_list:
|
|
raise Exception("Source has already been added.")
|
|
self.source_list.append(source)
|
|
|
|
def add(self, name, config, source):
|
|
if source not in self.source_list:
|
|
msg = "Source '{}' has not been added to the plugin cache."
|
|
raise Exception(msg.format(source))
|
|
|
|
if name not in self.plugin_configs:
|
|
self.plugin_configs[name] = OrderedDict()
|
|
self.plugin_configs[name][source] = config
|
|
|
|
def finalise_config(self):
|
|
pass
|
|
|
|
def disable_instrument(self, instrument):
|
|
pass
|
|
|
|
def add_device_config(self, config):
|
|
pass
|
|
|
|
def is_global_alias(self, name):
|
|
pass
|
|
|
|
def add_global_alias(self, name, value):
|
|
pass
|