config.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- python -*-
00003 #
00004 # @file omniidl_be/doil/config.py
00005 # @brief configuration module for doil backend
00006 # @date $Date$
00007 # @author Norkai Ando <n-ando@aist.go.jp>
00008 #
00009 #  Copyright (C) 2008
00010 #      Task-intelligence Research Group,
00011 #      Intelligent Systems Research Institute,
00012 #      National Institute of
00013 #          Advanced Industrial Science and Technology (AIST), Japan
00014 #      All rights reserved.
00015 #
00016 # $Id$
00017 #
00018 
00019 import string
00020 import config
00021 from omniidl_be.cxx import util
00022 
00023 class ConfigurationState:
00024     def __init__(self):
00025         self._config = {
00026             # Name of this program
00027             'Program Name':          'omniidl (doil adapter backend)',
00028             # Useful data from CVS
00029             'CVS ID':                '$Id$',
00030             # Relevant omniORB C++ library version
00031             'Library Version':       'omniORB_4_0',
00032             # Debug mode
00033             'Debug':                 True,
00034             #
00035             # generated classes for doil
00036             # - doil Interface
00037             # - CORBA Servant
00038             # - CORBA Adapter
00039             # - Ice slice
00040             # - Ice servant
00041             # - Ice adapter
00042             #
00043             'Interface':             False,
00044             'CORBAServant':          False,
00045             'CORBAAdapter':          False,
00046             'CORBAProxy':            False,
00047             'IceSlice':              False,
00048             'IceServant':            False,
00049             'IceAdapter':            False,    
00050             'IceProxy':              False,    
00051             #
00052             # Type mapping
00053             #
00054             'MappingFile':           '',
00055             'TypeMapping':           None,
00056             #
00057             # Additional includes
00058             #
00059             'IncludeHeaders':        [],
00060             #
00061             #
00062             #
00063             'ImplicitInclude':       False,
00064             #
00065             # Servant stuff
00066             #
00067             # Suffix of generated servant class
00068             'ServantSuffix':         'Servant',
00069             # Prefix of generated servant class
00070             'ServantPrefix':         '',
00071             # Namespace of servant class
00072             'ServantNs':             [],
00073             # servant class header directory
00074             'ServantDir':            '',
00075             #
00076             # Adapter stuff
00077             #
00078             # Suffix of generated servant class
00079             'AdapterSuffix':         'Adapter',
00080             # Prefix of generated servant class
00081             'AdapterPrefix':          '',
00082             # Namespace of servant class
00083             'AdapterNs':             [],
00084             # servant class header directory
00085             'AdapterDir':            '',
00086             #
00087             # Proxy stuff
00088             #
00089             # Suffix of generated proxy class
00090             'ProxySuffix':           'Proxy',
00091             # Prefix of generated proxy class
00092             'ProxyPrefix':           '',
00093             # Namespace of proxy class
00094             'ProxyNs':               [],
00095             # proxy class header directory
00096             'ProxyDir':              '',
00097             #
00098             # Interface stuff
00099             #
00100             # Suffix of generated servant class
00101             'IfaceSuffix':           '',
00102             # Prefix of generated servant class
00103             'IfacePrefix':           'I',
00104             # Namespace of delegated interface class
00105             'IfaceNs':               [],
00106             # interface class header directory
00107             'IfaceDir':              '',
00108             # Base name of file being processed
00109             'Basename':              None,
00110             # Directory name of file being processed
00111             'Directory':             None
00112             }
00113 
00114     def __getitem__(self, key):
00115         if self._config.has_key(key):
00116             return self._config[key]
00117         util.fatalError("Configuration key not found (" + key + ")")
00118 
00119     def __setitem__(self, key, value):
00120         if self._config.has_key(key):
00121             self._config[key] = value
00122             return
00123         util.fatalError("Configuration key not found (" + key + ")")
00124 
00125     def dump(self):
00126         # find the longest key string
00127         max = 0
00128         for key in self._config.keys():
00129             if len(key) > max: max = len(key)
00130         # display the table
00131         for key in self._config.keys():
00132             print string.ljust(key, max), ":  ", repr(self._config[key])
00133 
00134 # Create state-holding singleton object
00135 if not hasattr(config, "state"):
00136     config.state = ConfigurationState()


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:37