from .base_module_info import BaseModuleInfoError, BaseModuleInfo
-__version__ = '0.5.1'
+from .module_meta_info import ModuleMetadata
+
+__version__ = '0.5.2'
LOG = logging.getLogger(__name__)
# -------------------------------------------------------------------------
@property
def deleted_for(self):
- """The reason, why this module release was deleted.."""
+ """The reason, why this module release was deleted."""
return self._deleted_for
@deleted_for.setter
LOG.error(_("Got a {c} setting {w}: {e}").format(
c=e.__class__.__name__, w='downloads', e=e))
+ # -------------------------------------------------------------------------
+ @property
+ def file_md5(self):
+ """The MD5-sum of the current release package."""
+ return self._file_md5
+
+ @file_md5.setter
+ def file_md5(self, value):
+ if value is None:
+ self._file_md5 = None
+ return
+ v = str(value).strip()
+ if v == '':
+ self._file_md5 = None
+ return
+ self._file_md5 = v
+
+ # -------------------------------------------------------------------------
+ @property
+ def license(self):
+ """The license of module source."""
+ return self._license
+
+ @license.setter
+ def license(self, value):
+ if value is None:
+ self._license = None
+ return
+ v = str(value).strip()
+ if v == '':
+ self._license = None
+ return
+ self._license = v
# -------------------------------------------------------------------------
def as_dict(self, short=True):
res['changelog'] = self.changelog
res['deleted_for'] = self.deleted_for
res['downloads'] = self.downloads
+ res['file_md5'] = self.file_md5
+ res['license'] = self.license
return res
self.deleted_for = data['deleted_for']
if 'downloads' in data and data['downloads']:
self.downloads = data['downloads']
-
+ if 'file_md5' in data and data['file_md5']:
+ self.file_md5 = data['file_md5']
+ if 'license' in data and data['license']:
+ self.license = data['license']
+
+ if 'metadata' in data and data['metadata']:
+ self.metadata = ModuleMetadata.from_json_data(
+ data['metadata'], appname=self.appname,
+ verbose=self.verbose, base_dir=self.base_dir)
# =============================================================================
class ModuleReleaseList(collections.MutableSequence, FbBaseObject):