示例#1
0
 def save(self, entries, verbose=True):
     """Write bibkey -> (entrytype, fields) map to file."""
     _bibtex.save(entries,
                  filename=self.filepath.as_posix(),
                  sortkey=self.sortkey,
                  encoding=self.encoding,
                  verbose=verbose)
示例#2
0
 def save(self, entries, verbose=True):
     """Write bibkey -> (entrytype, fields) map to file."""
     _bibtex.save(
         entries,
         filename=self.filepath.as_posix(),
         sortkey=self.sortkey,
         encoding=self.encoding,
         verbose=verbose)
示例#3
0
 def to_bibfile(
     self,
     filename,
     encoding='utf-8',
 ):
     _bibtex.save(self.merged(),
                  filename.as_posix(),
                  sortkey=None,
                  encoding=encoding)
示例#4
0
def bibtex(api, log):
    bib = api.bibfiles['iso6393.bib']
    glottolog_ref_ids = bib.glottolog_ref_id_map

    entries = []
    for id_, rows in groupby(iter_change_requests(log),
                             lambda c: c['CR Number']):
        entries.append(
            change_request_as_source(id_, list(rows), glottolog_ref_ids))
    save(entries, bib.fname, None)
    log.info('bibtex written to {0}'.format(bib.fname))
    return len(entries)
示例#5
0
 def to_bibfile(self, filename, encoding='utf-8', ):
     _bibtex.save(self.merged(), filename.as_posix(), sortkey=None, encoding=encoding)
示例#6
0
 def save(self, entries):
     """Write bibkey -> (entrytype, fields) map to file."""
     _bibtex.save(
         entries, filename=self.fname, sortkey=self.sortkey, encoding=self.encoding)