From: Oleg Broytman Date: Fri, 25 Dec 2015 19:40:50 +0000 (+0300) Subject: Rename data -> glst X-Git-Tag: 0.0.4~68 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=d0a1abea3d89062e8f9b71dd6df45db5d8b84997;p=m_librarian.git Rename data -> glst --- diff --git a/m_librarian/glst.py b/m_librarian/glst.py index 867d413..44ec612 100755 --- a/m_librarian/glst.py +++ b/m_librarian/glst.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -__all__ = ['import_data'] +__all__ = ['import_glst'] import codecs import os @@ -42,23 +42,23 @@ def import_glst_file(glst_filename): return old, new -def _import_data(): +def _import_glst(): ml_dir = os.path.dirname(__file__) old_fb2, new_fb2 = import_glst_file( - os.path.join(ml_dir, 'data', 'genres_fb2.glst')) + os.path.join(ml_dir, 'glst', 'genres_fb2.glst')) old_nonfb2, new_nonfb2 = import_glst_file( - os.path.join(ml_dir, 'data', 'genres_nonfb2.glst')) + os.path.join(ml_dir, 'glst', 'genres_nonfb2.glst')) sqlhub.processConnection.query("VACUUM %s" % Genre.sqlmeta.table) return old_fb2 + old_nonfb2, new_fb2 + new_nonfb2 -def import_data(): - return sqlhub.doInTransaction(_import_data) +def import_glst(): + return sqlhub.doInTransaction(_import_glst) def test(): ml_dir = os.path.dirname(__file__) - print parse_glst_file(os.path.join(ml_dir, 'data', 'genres_fb2.glst')) + print parse_glst_file(os.path.join(ml_dir, 'glst', 'genres_fb2.glst')) if __name__ == '__main__': test() diff --git a/m_librarian/data/.gitattributes b/m_librarian/glst/.gitattributes similarity index 100% rename from m_librarian/data/.gitattributes rename to m_librarian/glst/.gitattributes diff --git a/m_librarian/data/License.txt b/m_librarian/glst/License.txt similarity index 100% rename from m_librarian/data/License.txt rename to m_librarian/glst/License.txt diff --git a/m_librarian/data/README.rus.txt b/m_librarian/glst/README.rus.txt similarity index 100% rename from m_librarian/data/README.rus.txt rename to m_librarian/glst/README.rus.txt diff --git a/m_librarian/data/genres_fb2.glst b/m_librarian/glst/genres_fb2.glst similarity index 100% rename from m_librarian/data/genres_fb2.glst rename to m_librarian/glst/genres_fb2.glst diff --git a/m_librarian/data/genres_nonfb2.glst b/m_librarian/glst/genres_nonfb2.glst similarity index 100% rename from m_librarian/data/genres_nonfb2.glst rename to m_librarian/glst/genres_nonfb2.glst diff --git a/setup.py b/setup.py index 7d293ce..d616820 100755 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup(name='m_librarian', 'Programming Language :: Python :: 2 :: Only', ], packages=['m_librarian'], - package_data={'m_librarian': ['data/*.txt', 'data/genres_*.glst']}, + package_data={'m_librarian': ['glst/*.txt', 'glst/genres_*.glst']}, scripts=['scripts/ml-import.py', 'scripts/ml-initdb.py'], requires=['SQLObject'], )