From 67f5a6e5ce8bd3d5cf2cb39d61bceaf2b2515061 Mon Sep 17 00:00:00 2001 From: Yuanle Song Date: Thu, 8 Sep 2016 13:03:18 +0800 Subject: [PATCH] v0.15.0 add default db config variables in config.py --- operational | 1 + project.clj | 2 +- src/leiningen/new/python/config.py | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/operational b/operational index cd17ca8..f5210c4 100644 --- a/operational +++ b/operational @@ -5,6 +5,7 @@ Time-stamp: <2016-09-08> * current :entry: ** ** 2016-09-08 integrate sanity-check +- update yygame-utils pkg version - in Makefile check: just-test +sanity-check: diff --git a/project.clj b/project.clj index c668235..db2cb6b 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject python/lein-template "0.14.0" +(defproject python/lein-template "0.15.0" :description "lein template for a python project" :repositories [["snapshots" {:url "http://devserv.game.yy.com/nexus/content/repositories/snapshots" diff --git a/src/leiningen/new/python/config.py b/src/leiningen/new/python/config.py index 37e48e5..7a43e7e 100644 --- a/src/leiningen/new/python/config.py +++ b/src/leiningen/new/python/config.py @@ -20,7 +20,19 @@ logger = logging.getLogger(__name__) TESTING = os.getenv("PYTEST") == "1" +# set root logger level to ERROR when running unit test. +if TESTING: + logging.getLogger('').setLevel(logging.ERROR) + DEFAULTS = { + "db.host": "localhost", + "db.port": "5432", + "db.name": "{{name}}", + "db.user": "{{name}}", + "db.password": "", + "redis.host": "localhost", + "redis.port": "6379", + "redis.db": "0", } OPTIONAL_KEYS = list(DEFAULTS.keys()) -- GitLab