2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
14 # Copyright 2016 RIFT.io Inc
17 ''' Initialize the global configuration for the translator '''
21 from rift
.mano
.tosca_translator
.conf
.config
import ConfigProvider
23 CONF_FILENAME
= 'translator.conf'
26 def init_global_conf():
27 '''Initialize the configuration provider.
29 Allows the configuration to be shared throughout the translator code.
30 The file used is translator.conf, and is within the conf/ directory. It
31 is a standard ini format, and is prcessed using the ConfigParser module.
34 conf_path
= os
.path
.dirname(os
.path
.abspath(__file__
))
35 conf_file
= os
.path
.join(conf_path
, CONF_FILENAME
)
36 ConfigProvider
._load
_config
(conf_file
)