from .xlate import XLATOR
-__version__ = '0.4.1'
+__version__ = '0.4.2'
LOG = logging.getLogger(__name__)
self._source = None
self.dependencies = []
self.requirements = []
+ self._project_page = None
+ self._issues_url = None
super(ModuleMetadata, self).__init__(
appname=appname, verbose=verbose, version=version,
return
self._source = to_str(value).strip()
+ # -------------------------------------------------------------------------
+ @property
+ def project_page(self):
+ """The project page of the module."""
+ return self._project_page
+
+ @project_page.setter
+ def project_page(self, value):
+ if value is None:
+ self._project_page = None
+ return
+ self._project_page = to_str(value).strip()
+
+ # -------------------------------------------------------------------------
+ @property
+ def issues_url(self):
+ """The link to the module's issue tracker."""
+ return self._issues_url
+
+ @issues_url.setter
+ def issues_url(self, value):
+ if value is None:
+ self._issues_url = None
+ return
+ self._issues_url = to_str(value).strip()
+
# -------------------------------------------------------------------------
def as_dict(self, short=True):
"""
res['requirements'] = []
for req in self.requirements:
res['requirements'].append(req.as_dict())
+ res['project_page'] = self.project_page
+ res['issues_url'] = self.issues_url
return res
for item in json_data['requirements']:
req = ModuleDependency.from_data(item)
metadata.requirements.append(req)
+ if 'project_page' in json_data:
+ metadata.project_page = json_data['project_page']
+ if 'issues_url' in json_data:
+ metadata.issues_url = json_data['issues_url']
metadata.initialized = True
if verbose > 3:
new.dependencies.append(copy.copy(dep))
for req in self.requirements:
new.requirements.append(copy.copy(req))
+ new.project_page = self.project_page
+ new.issues_url = self.issues_url
new.initialized = True
data['requirements'] = []
for req in self.requirements:
data['requirements'].append(req.to_data())
+ if self.project_page:
+ data['project_page'] = self.project_page
+ if self.issues_url:
+ data['issues_url'] = self.issues_url
if self.verbose > 4:
LOG.debug("ModuleMetadata:\n{}".format(pp(data)))