]> git.phdru.name Git - m_librarian.git/blobdiff - scripts/ml-initdb.py
Docs: Update TODO
[m_librarian.git] / scripts / ml-initdb.py
index 6535d4559827ac37b7b4ffa36925f39604ff03b5..4c21b1aaf0b3b0bb83816c754cd18fac54ed5c57 100755 (executable)
@@ -1,13 +1,13 @@
 #! /usr/bin/env python
 
-from __future__ import print_function
 import argparse
+
 from m_librarian.config import get_config
 from m_librarian.db import open_db, init_db
 from m_librarian.glst import import_glst
 
 if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description='Init')
+    parser = argparse.ArgumentParser(description='Init database')
     parser.add_argument('-C', '--config', help='configuration file')
     parser.add_argument('-D', '--database', help='database URI')
     args = parser.parse_args()
@@ -17,8 +17,9 @@ if __name__ == '__main__':
 
     open_db(args.database)
     init_db()
-    old, new = import_glst()
-    if old:
-        print("Imported %d genres (ignored %d existing)" % (new, old))
+    count_old, count_new = import_glst()
+    if count_old:
+        print("Imported %d genres (ignored %d existing)" % (
+            count_new, count_old))
     else:
-        print("Imported %d genres" % new)
+        print("Imported %d genres" % count_new)