self._name = None
self._version = None
self._author = None
+ self._license = None
+ self._summary = None
+ self._source = None
super(ModuleMetadata, self).__init__(
appname=appname, verbose=verbose, version=version,
return
self._author = to_str(value).strip()
+ # -------------------------------------------------------------------------
+ @property
+ def license(self):
+ """The license of the module."""
+ return self._license
+
+ @license.setter
+ def license(self, value):
+ if value is None:
+ self._license = None
+ return
+ self._license = to_str(value).strip()
+
+ # -------------------------------------------------------------------------
+ @property
+ def summary(self):
+ """The summary of the module."""
+ return self._summary
+
+ @summary.setter
+ def summary(self, value):
+ if value is None:
+ self._summary = None
+ return
+ self._summary = to_str(value).strip()
+
+ # -------------------------------------------------------------------------
+ @property
+ def source(self):
+ """The source of the module."""
+ return self._source
+
+ @source.setter
+ def source(self, value):
+ if value is None:
+ self._source = None
+ return
+ self._source = to_str(value).strip()
+
# -------------------------------------------------------------------------
def as_dict(self, short=True):
"""
res['name'] = self.name
res['version'] = self.version
res['author'] = self.author
+ res['license'] = self.license
+ res['summary'] = self.summary
+ res['source'] = self.source
return res
required_props = {
'name': 'Name',
'version': 'Version',
+ 'license': 'License',
+ 'summary': 'Summary',
+ 'source': 'Source',
}
for prop in required_props.keys():
metadata.author = json_data['author']
else:
metadata.author = metadata.author
+ metadata.license = json_data['license']
+ metadata.summary = json_data['summary']
+ metadata.source = json_data['source']
metadata.initialized = True
if verbose > 3:
new.name = self.name
new.version = self.version
new.author = self.author
+ new.license = self.license
+ new.summary = self.summary
+ new.source = self.source
new.initialized = True
data['name'] = self.name
data['version'] = self.version
data['author'] = self.author
+ data['license'] = self.license
+ data['summary'] = self.summary
+ data['source'] = self.source
if self.verbose > 4:
LOG.debug("ModuleMetadata:\n{}".format(pp(data)))