5 from m_librarian.config import get_config
6 from m_librarian.db import open_db, init_db
7 from m_librarian.glst import import_glst
9 if __name__ == '__main__':
10 parser = argparse.ArgumentParser(description='Init database')
11 parser.add_argument('-C', '--config', help='configuration file')
12 parser.add_argument('-D', '--database', help='database URI')
13 args = parser.parse_args()
16 get_config(args.config) # Get and cache config file
18 open_db(args.database)
20 count_old, count_new = import_glst()
22 print("Imported %d genres (ignored %d existing)" % (
23 count_new, count_old))
25 print("Imported %d genres" % count_new)