def _load_metadata(self, filename): if not filename or not os.path.exists(filename): return {} extension_py = open(filename).read() metadata = dict(re.findall("__([a-z_]+)__ = '([^']+)'", extension_py)) # Support for using gpodder.gettext() as _ to localize text localized_metadata = dict(re.findall("__([a-z_]+)__ = _\('([^']+)'\)", extension_py)) for key in localized_metadata: metadata[key] = gpodder.gettext(localized_metadata[key]) return metadata