From 75821715e295abf0f67faaf80be3f03ac939d47c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 21 Dec 2015 18:53:42 +0300 Subject: [PATCH] Minor refactoring: split test() functions --- m_librarian/config.py | 6 +++++- m_librarian/db.py | 5 ++++- m_librarian/glst.py | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/m_librarian/config.py b/m_librarian/config.py index f1dfdb7..c57406b 100755 --- a/m_librarian/config.py +++ b/m_librarian/config.py @@ -23,6 +23,10 @@ for d in config_dirs: else: ml_conf = ml_conf_file = None -if __name__ == '__main__': + +def test(): print "Config dirs:", config_dirs print "Config file:", ml_conf_file + +if __name__ == '__main__': + test() diff --git a/m_librarian/db.py b/m_librarian/db.py index d176e7b..28033f5 100755 --- a/m_librarian/db.py +++ b/m_librarian/db.py @@ -86,7 +86,10 @@ def init_db(): return -if __name__ == '__main__': +def test(): print "DB dirs:", db_dirs if db_uri: print "DB URI:", db_uri + +if __name__ == '__main__': + test() diff --git a/m_librarian/glst.py b/m_librarian/glst.py index cd2b8c9..6ff58de 100755 --- a/m_librarian/glst.py +++ b/m_librarian/glst.py @@ -54,6 +54,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() -- 2.39.5