From: Oleg Broytman Date: Mon, 21 Dec 2015 15:53:42 +0000 (+0300) Subject: Minor refactoring: split test() functions X-Git-Tag: 0.0.3~11 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=75821715e295abf0f67faaf80be3f03ac939d47c;p=m_librarian.git Minor refactoring: split test() functions --- 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()