]> git.phdru.name Git - m_librarian.git/commitdiff
Minor refactoring: split test() functions
authorOleg Broytman <phd@phdru.name>
Mon, 21 Dec 2015 15:53:42 +0000 (18:53 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 21 Dec 2015 15:53:42 +0000 (18:53 +0300)
m_librarian/config.py
m_librarian/db.py
m_librarian/glst.py

index f1dfdb7c6866112b4f9a76e986c9874679e87dea..c57406ba1601e11901b337e43b8ba6a01d60c340 100755 (executable)
@@ -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()
index d176e7bc629fee4583ac325ea41743ea1fa4cef5..28033f547a4408cd826215ead5dc2bb763ad4da6 100755 (executable)
@@ -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()
index cd2b8c90f33a7235c86d7dc9e12887253f07e95f..6ff58de3d93fef990806ce1e4638d8ec5299ed21 100755 (executable)
@@ -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()