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>
		
			
				
	
	
		
			38 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			1.0 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.
 | |
| 
 | |
| import copy
 | |
| 
 | |
| import otc_metadata.data
 | |
| 
 | |
| __all__ = ["Service"]
 | |
| 
 | |
| BUILTIN_DATA = otc_metadata.data.read_data("docs.yaml")
 | |
| 
 | |
| 
 | |
| def _normalize_type(service_type):
 | |
|     if service_type:
 | |
|         return service_type.replace("_", "-")
 | |
| 
 | |
| 
 | |
| class Service(object):
 | |
|     """Encapsulation of the OTC Docs data"""
 | |
| 
 | |
|     def __init__(self):
 | |
|         self._service_data = BUILTIN_DATA
 | |
| 
 | |
|     @property
 | |
|     def all_services(self):
 | |
|         "Service Categories data listing."
 | |
|         return copy.deepcopy(self._service_data["services"])
 |