示例#1
0
 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)
示例#2
0
 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__()
示例#3
0
 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__()
示例#4
0
文件: bibtex.py 项目: mitcho/clld
 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__()
示例#5
0
 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__()