def format(self, fmt): if fmt == 'txt': if hasattr(self, 'text'): return self.text() raise NotImplementedError('no text method found!') if fmt == 'en': return convert(str(self), 'bib', 'end') if fmt == 'ris': return convert(str(self), 'bib', 'ris') if fmt == 'mods': return convert(str(self), 'bib') return str(self)
def format(self, fmt): if fmt == "txt": if hasattr(self, "text"): return self.text() raise NotImplementedError("no text method found!") if fmt == "en": return convert(self.__unicode__(), "bib", "end") if fmt == "ris": return convert(self.__unicode__(), "bib", "ris") if fmt == "mods": return convert(self.__unicode__(), "bib") return self.__unicode__()
def format(self, fmt): if fmt == 'txt': if hasattr(self, 'text'): return self.text() raise NotImplementedError('no text method found!') if fmt == 'en': return convert(self.__unicode__(), 'bib', 'end') if fmt == 'ris': return convert(self.__unicode__(), 'bib', 'ris') if fmt == 'mods': return convert(self.__unicode__(), 'bib') return self.__unicode__()
def format(self, fmt): if fmt == 'txt': if hasattr(self, 'text'): return self.text() raise NotImplementedError() # pragma: no cover if fmt == 'en': return convert(self.__unicode__(), 'bib', 'end') if fmt == 'ris': return convert(self.__unicode__(), 'bib', 'ris') if fmt == 'mods': return convert(self.__unicode__(), 'bib') return self.__unicode__()