From: Frank Brehm Date: Tue, 26 Feb 2019 15:54:49 +0000 (+0100) Subject: Continuing with failing properties of class ForgeModuleInfo X-Git-Tag: 1.6.4^2~43 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=ecd4013f67352d7bab83efe607e2cd55907ff956;p=pixelpark%2Fpuppetmaster-webhooks.git Continuing with failing properties of class ForgeModuleInfo --- diff --git a/lib/webhooks/forge_module_info.py b/lib/webhooks/forge_module_info.py index 35a8e03..82e5b60 100644 --- a/lib/webhooks/forge_module_info.py +++ b/lib/webhooks/forge_module_info.py @@ -31,7 +31,7 @@ from .base_module_info import BaseModuleInfoError, BaseModuleInfo from .module_meta_info import ModuleMetadata -__version__ = '0.6.1' +__version__ = '0.6.2' LOG = logging.getLogger(__name__) @@ -1329,7 +1329,7 @@ class ForgeModuleInfo(BaseModuleInfo): # ------------------------------------------------------------------------- @property def deprecated_for(self): - """The reason of deprecation of this forge module..""" + """The reason of deprecation of this forge module.""" return self._deprecated_for @deprecated_for.setter @@ -1398,6 +1398,74 @@ class ForgeModuleInfo(BaseModuleInfo): raise ValueError(msg) self._feedback_score = v + # ------------------------------------------------------------------------- + @property + def homepage_url(self): + """The homepage URL of this forge module.""" + return self._homepage_url + + @homepage_url.setter + def homepage_url(self, value): + if value is None: + self._homepage_url = None + return + v = str(value).strip() + if value == '': + self._homepage_url = None + return + self._homepage_url = v + + # ------------------------------------------------------------------------- + @property + def issues_url(self): + """The issues URL of this forge module.""" + return self._issues_url + + @issues_url.setter + def issues_url(self, value): + if value is None: + self._issues_url = None + return + v = str(value).strip() + if value == '': + self._issues_url = None + return + self._issues_url = v + + # ------------------------------------------------------------------------- + @property + def module_group(self): + """The module group of this forge module.""" + return self._module_group + + @module_group.setter + def module_group(self, value): + if value is None: + self._module_group = None + return + v = str(value).strip() + if value == '': + self._module_group = None + return + self._module_group = v + + # ------------------------------------------------------------------------- + @property + def slug(self): + """The slug of this forge module.""" + return self._slug + + @slug.setter + def slug(self, value): + if value is None: + self._slug = None + return + v = str(value).strip() + if value == '': + self._slug = None + return + self._slug = v + # ------------------------------------------------------------------------- def as_dict(self, short=True): @@ -1409,6 +1477,10 @@ class ForgeModuleInfo(BaseModuleInfo): res['downloads'] = self.downloads res['endorsement'] = self.endorsement res['feedback_score'] = self.feedback_score + res['homepage_url'] = self.homepage_url + res['issues_url'] = self.issues_url + res['module_group'] = self.module_group + res['slug'] = self.slug return res @@ -1430,7 +1502,11 @@ class ForgeModuleInfo(BaseModuleInfo): res['downloads'] = self.downloads res['endorsement'] = self.endorsement res['feedback_score'] = self.feedback_score + res['homepage_url'] = self.homepage_url + res['issues_url'] = self.issues_url + res['module_group'] = self.module_group res['name'] = self.name + res['slug'] = self.slug res['releases'] = [] for release in self.releases: @@ -1501,7 +1577,7 @@ class ForgeModuleInfo(BaseModuleInfo): for prop_name in ( 'created_at', 'deprecated_at', 'deprecated_for', 'downloads', 'endorsement', - 'feedback_score',): + 'feedback_score', 'homepage_url', 'issues_url', 'module_group', 'slug'): if prop_name in js_info and js_info[prop_name]: setattr(module_info, prop_name, js_info[prop_name])