Add warnings for missing activity metadata

- report a warning if either activity_version, icon, or license are
  missing,

- fix typo in missing bundle_id exception message.

Fixes #378

Co-authored-by: Rahul Bothra <f2016015@pilani.bits-pilani.ac.in>
master
James Cameron 6 years ago
parent 7e216a04d5
commit cc2357c787

@ -143,7 +143,7 @@ class ActivityBundle(Bundle):
'changed to bundle_id')
else:
raise MalformedBundleException(
'Activity bundle %s does not specify a bundle id' %
'Activity bundle %s does not specify a bundle_id' %
self.get_path())
if ' ' in self._bundle_id:
@ -182,6 +182,10 @@ class ActivityBundle(Bundle):
if cp.has_option(section, 'icon'):
self._icon = cp.get(section, 'icon')
else:
logging.warning(
'Activity bundle %s does not specify an icon' %
self.get_path())
if cp.has_option(section, 'activity_version'):
version = cp.get(section, 'activity_version')
@ -192,6 +196,10 @@ class ActivityBundle(Bundle):
'Activity bundle %s has invalid version number %s' %
(self.get_path(), version))
self._activity_version = version
else:
logging.warning(
'Activity bundle %s does not specify an activity_version, '
'assuming %s' % (self.get_path(), self._activity_version))
if cp.has_option(section, 'summary'):
self._summary = cp.get(section, 'summary')
@ -211,6 +219,11 @@ class ActivityBundle(Bundle):
'Activity bundle %s has invalid max_participants %s' %
(self.get_path(), max_participants))
if not cp.has_option(section, 'license'):
logging.warning(
'Activity bundle %s does not specify a license' %
self.get_path())
def _get_linfo_file(self):
# Using method from gettext.py, first find languages from environ
languages = []

Loading…
Cancel
Save