X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fglst.py;h=867d4136590e2a0f4ccee0c429e0e7e270f065bf;hb=ee08410d892e2facfbe8469a78a661c3e366ff8c;hp=257d321fdaf9b71b4938a600ce50073f5b6a9a15;hpb=fb881e5d6e0de019b19bc2aa007c7783c73d9ce5;p=m_librarian.git diff --git a/m_librarian/glst.py b/m_librarian/glst.py index 257d321..867d413 100755 --- a/m_librarian/glst.py +++ b/m_librarian/glst.py @@ -1,5 +1,7 @@ #! /usr/bin/env python +__all__ = ['import_data'] + import codecs import os from sqlobject import sqlhub, SQLObjectNotFound @@ -46,6 +48,7 @@ def _import_data(): os.path.join(ml_dir, 'data', 'genres_fb2.glst')) old_nonfb2, new_nonfb2 = import_glst_file( os.path.join(ml_dir, 'data', 'genres_nonfb2.glst')) + sqlhub.processConnection.query("VACUUM %s" % Genre.sqlmeta.table) return old_fb2 + old_nonfb2, new_fb2 + new_nonfb2 @@ -53,6 +56,9 @@ def import_data(): return sqlhub.doInTransaction(_import_data) -if __name__ == '__main__': +def test(): ml_dir = os.path.dirname(__file__) print parse_glst_file(os.path.join(ml_dir, 'data', 'genres_fb2.glst')) + +if __name__ == '__main__': + test()