+
+ 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" % count_new)
+
+ use_pbar = ttyProgressBar and not args.no_pbar and sys.stdout.isatty()
+ for inpx in args.inpx:
+ if use_pbar:
+ if len(inpx) > 25:
+ pbar_fname = inpx[:22] + '...'
+ else:
+ pbar_fname = inpx
+ print(pbar_fname.ljust(20), end=': ')
+ sys.stdout.flush()
+ pbar = ml_ttyProgressBar()
+ import_inpx(inpx, pbar_cb=pbar)
+ print("Ok")
+ else:
+ import_inpx(inpx)
+ if use_pbar:
+ print("Updating counters", end=': ')
+ sys.stdout.flush()
+ pbar = ml_ttyProgressBar()
+ update_counters(pbar_cb=pbar)
+ print("Ok")
+ else:
+ update_counters()