Build a Bundle object :param bundle_dict: the dictionary of the bundle :param i18n: the i18n dictionary (language code: {key: value}) :return: a Bundle object
(cls, bundle_dict: Dict)
| 23 | |
| 24 | @classmethod |
| 25 | def build(cls, bundle_dict: Dict): |
| 26 | """ |
| 27 | Build a Bundle object |
| 28 | :param bundle_dict: the dictionary of the bundle |
| 29 | :param i18n: the i18n dictionary (language code: {key: value}) |
| 30 | :return: a Bundle object |
| 31 | """ |
| 32 | bundle_id = bundle_dict["id"] |
| 33 | return cls( |
| 34 | bundle_id=bundle_id, |
| 35 | provider=bundle_dict["provider"], |
| 36 | developer=bundle_dict["developer"], |
| 37 | name=bundle_dict["name"], |
| 38 | description=bundle_dict["description"], |
| 39 | credentials_schema=bundle_dict.get("credentials_schema", {}), |
| 40 | icon_url=f"{CONFIG.ICON_URL_PREFIX}/images/plugins/bundles/icons/{bundle_id}.png" |
| 41 | ) |
| 42 | |
| 43 | def to_dict(self, lang: str): |
| 44 | credentials_schema_dict = { |
no test coverage detected