예제 #1
0
 def _bibfiles(cls, directory, config, endwith):
     """Read the INI-file, yield bibfile instances for sections."""
     cfg = INI(interpolation=None)
     cfg.read(os.path.join(directory, '..', config))
     for s in cfg.sections():
         if not s.endswith(endwith):
             continue
         filepath = os.path.join(directory, s)
         assert os.path.exists(filepath)
         sortkey = cfg.get(s, 'sortkey')
         if sortkey.lower() == 'none':
             sortkey = None
         yield BibFile(
             filepath=filepath,
             encoding=cfg.get(s, 'encoding'), sortkey=sortkey,
             use_pybtex=cfg.getboolean(s, 'use_pybtex'),
             priority=cfg.getint(s, 'priority'),
             name=cfg.get(s, 'name'), title=cfg.get(s, 'title'),
             description=cfg.get(s, 'description'),
             abbr=cfg.get(s, 'abbr'))