Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-committed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
		
			
				
	
	
		
			36 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| # 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.
 | |
| __all__ = ["__version__", "Docs"]
 | |
| 
 | |
| import pbr.version
 | |
| 
 | |
| from otc_metadata.services import Services  # flake8: noqa
 | |
| 
 | |
| __version__ = pbr.version.VersionInfo("otc-metadata").version_string()
 | |
| _service_manager = None
 | |
| 
 | |
| 
 | |
| def get_service_data(*args, **kwargs):
 | |
|     """Return singleton instance of the Services object.
 | |
|     Parameters are all passed through to the
 | |
|     :class:`~otc_metadata.services.Services` constructor.
 | |
|     .. note::
 | |
|       Only one singleton is kept, so if instances with different parameter
 | |
|       values are desired, directly calling the constructor is necessary.
 | |
|     :returns: Singleton instance of
 | |
|         :class:`~otc_metadata.services.Services`
 | |
|     """
 | |
|     global _service_manager
 | |
|     if not _service_manager:
 | |
|         _service_manager = Services(*args, **kwargs)
 | |
|     return _service_manager
 |