Example #1
0
def index(args):
    """Create an index page listing and linking to all languoids of a specified level.

    glottolog index (family|language|dialect|all)
    """
    for level in Level:
        if args.args[0] in [level.name, 'all']:
            make_index(level, repos=args.repos)
Example #2
0
def index(args):
    """Create an index page listing and linking to all languoids of a specified level.

    glottolog index (family|language|dialect|all)
    """
    for level in ['family', 'language', 'dialect']:
        if args.args[0] in [level, 'all']:
            make_index(level)
Example #3
0
    def test_make_index(self):
        from pyglottolog.languoids import make_index, Level

        for level in Level:
            res = make_index(level, repos=self.tmp_path())
            self.assertEqual(len(res), 3 if level == Level.language else 2)
            self.assertTrue(all(p.exists() for p in res))