| Total Complexity | 5 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from .requester import Requester |
||
| 2 | from .api_wrappers import API_CLASSES |
||
| 3 | |||
| 4 | |||
| 5 | class NextCloud(object): |
||
| 6 | |||
| 7 | def __init__(self, endpoint, user, password, json_output=True): |
||
| 8 | self.query_components = [] |
||
| 9 | |||
| 10 | requester = Requester(endpoint, user, password, json_output) |
||
| 11 | |||
| 12 | self.functionality_classes = [api_class(requester) for api_class in API_CLASSES] |
||
| 13 | |||
| 14 | for functionality_class in self.functionality_classes: |
||
| 15 | for potential_method in dir(functionality_class): |
||
| 16 | if potential_method.startswith('_') or not callable(getattr(functionality_class, potential_method)): |
||
| 17 | continue |
||
| 18 | setattr(self, potential_method, getattr(functionality_class, potential_method)) |
||
| 19 |