parameters.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2015 Airbus
00004 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00005 #
00006 # Licensed under the Apache License, Version 2.0 (the "License");
00007 # you may not use this file except in compliance with the License.
00008 # You may obtain a copy of the License at
00009 #
00010 #   http://www.apache.org/licenses/LICENSE-2.0
00011 #
00012 # Unless required by applicable law or agreed to in writing, software
00013 # distributed under the License is distributed on an "AS IS" BASIS,
00014 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015 # See the License for the specific language governing permissions and
00016 # limitations under the License.
00017 
00018 
00019 class Parameters():
00020     
00021     def __init__(self):
00022         self._params = {}
00023         
00024     def putParam(self, name, values):
00025         
00026         if not self._params.has_key(name):
00027             self._params.update({name:values})
00028         else:
00029             self._params[name] = values
00030         
00031     def getParam(self, name, default=None):
00032         
00033         if self._params.has_key(name):
00034             return self._params[name]
00035         elif default is not None:
00036             return default
00037         
00038         return None
00039     
00040     def __str__(self):
00041         
00042         params_str = "Parameters :\n"
00043         
00044         for k,v in self._params.items():
00045             params_str+= "  - %s : %s\n"%(k,str(v))
00046             
00047         return params_str
00048     
00049     


airbus_cobot_gui
Author(s): Martin Matignon
autogenerated on Thu Jun 6 2019 17:59:19