| 1 |
4 |
danv |
###############################################################################
|
| 2 |
|
|
#
|
| 3 |
|
|
# Copyright (C) 2014-2018
|
| 4 |
|
|
# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
|
| 5 |
|
|
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
|
| 6 |
|
|
#
|
| 7 |
|
|
# This program is free software: you can redistribute it and/or modify
|
| 8 |
|
|
# it under the terms of the GNU General Public License as published by
|
| 9 |
|
|
# the Free Software Foundation, either version 3 of the License, or
|
| 10 |
|
|
# (at your option) any later version.
|
| 11 |
|
|
#
|
| 12 |
|
|
# This program is distributed in the hope that it will be useful,
|
| 13 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
|
|
# GNU General Public License for more details.
|
| 16 |
|
|
#
|
| 17 |
|
|
# You should have received a copy of the GNU General Public License
|
| 18 |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 19 |
|
|
#
|
| 20 |
|
|
# $Id$
|
| 21 |
|
|
#
|
| 22 |
|
|
###############################################################################
|
| 23 |
|
|
|
| 24 |
|
|
from hdl_configfile import HdlTool, HdlBuildset, HdlLib
|
| 25 |
|
|
from configtree import ConfigTree
|
| 26 |
|
|
|
| 27 |
|
|
__all__ = ['HdlToolTree', 'HdlBuildsetTree', 'HdlLibTree']
|
| 28 |
|
|
|
| 29 |
|
|
|
| 30 |
|
|
class HdlToolTree(ConfigTree):
|
| 31 |
|
|
"""
|
| 32 |
|
|
Class the represents the content of a set of hdltool_<tool>.cfg configuration files.
|
| 33 |
|
|
"""
|
| 34 |
|
|
def __init__(self, rootdirs, filename, sections=None):
|
| 35 |
|
|
"""
|
| 36 |
|
|
Read the hdltool configuration files and stores them in this tree.
|
| 37 |
|
|
:raise ConfigFileException
|
| 38 |
|
|
"""
|
| 39 |
|
|
super(HdlToolTree, self).__init__(rootdirs, filename, sections)
|
| 40 |
|
|
|
| 41 |
|
|
def _factory_constructor(self, full_filename):
|
| 42 |
|
|
"Function for returning the readin configfile."
|
| 43 |
|
|
return HdlTool(full_filename)
|
| 44 |
|
|
|
| 45 |
|
|
|
| 46 |
|
|
class HdlBuildsetTree(ConfigTree):
|
| 47 |
|
|
"""
|
| 48 |
|
|
Class the represents the content of a set of hdl_buildset_<buildset>.cfg configuration files.
|
| 49 |
|
|
"""
|
| 50 |
|
|
def __init__(self, rootdirs, filename, sections=None):
|
| 51 |
|
|
"""
|
| 52 |
|
|
Read the hdlbuildset configuration files and stores them in this tree.
|
| 53 |
|
|
:raise ConfigFileException
|
| 54 |
|
|
"""
|
| 55 |
|
|
super(HdlBuildsetTree, self).__init__(rootdirs, filename, sections)
|
| 56 |
|
|
|
| 57 |
|
|
def _factory_constructor(self, full_filename):
|
| 58 |
|
|
"Function for returning the readin configfile."
|
| 59 |
|
|
return HdlBuildset(full_filename)
|
| 60 |
|
|
|
| 61 |
|
|
|
| 62 |
|
|
class HdlLibTree(ConfigTree):
|
| 63 |
|
|
"""
|
| 64 |
|
|
Class the represents the content of a set of hdllib.cfg configuration files.
|
| 65 |
|
|
"""
|
| 66 |
|
|
def __init__(self, rootdirs, filename, sections=None):
|
| 67 |
|
|
"""
|
| 68 |
|
|
Reads the hdllib configuration files and stores them in this tree.
|
| 69 |
|
|
:raise ConfigFileException
|
| 70 |
|
|
"""
|
| 71 |
|
|
super(HdlLibTree, self).__init__(rootdirs, filename, sections)
|
| 72 |
|
|
|
| 73 |
|
|
def _factory_constructor(self, full_filename):
|
| 74 |
|
|
"Function for returning the readin configfile."
|
| 75 |
|
|
return HdlLib(full_filename)
|