public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/, tests/
@ 2013-07-10 16:16 André Erdmann
  2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
  0 siblings, 1 reply; 2+ messages in thread
From: André Erdmann @ 2013-07-10 16:16 UTC (permalink / raw
  To: gentoo-commits

commit:     176e55595664470938e81c75c6544bbec361442b
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jul 10 16:13:59 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jul 10 16:13:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=176e5559

roverlay/__init__.py: make logger setup optional

---
 roverlay/__init__.py | 12 +++++++-----
 tests/base.py        |  4 +++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/roverlay/__init__.py b/roverlay/__init__.py
index cd93ba1..7930c4a 100644
--- a/roverlay/__init__.py
+++ b/roverlay/__init__.py
@@ -30,16 +30,17 @@ def setup_initial_logger():
    """Sets up initial logging."""
    roverlay.recipe.easylogger.setup_initial()
 
-def load_config_file ( cfile, extraconf=None ):
+def load_config_file ( cfile, extraconf=None, setup_logger=True ):
    """
    Loads the config, including the field definition file.
    Sets up the logger afterwards.
    (Don't call this method more than once.)
 
    arguments:
-   * cfile     -- path to the config file
-   * extraconf -- a dict with additional config entries that will override
-                  entries read from cfile
+   * cfile        -- path to the config file
+   * extraconf    -- a dict with additional config entries that will override
+                      entries read from cfile
+   * setup_logger -- set up logger (defaults to True)
    """
    roverlay_config = roverlay.config.access()
 
@@ -51,7 +52,8 @@ def load_config_file ( cfile, extraconf=None ):
    if extraconf is not None:
       roverlay_config.merge_with ( extraconf )
 
-   roverlay.recipe.easylogger.setup ( roverlay_config )
+   if setup_logger:
+      roverlay.recipe.easylogger.setup ( roverlay_config )
 
    confloader.load_field_definition (
       roverlay_config.get_or_fail ( "DESCRIPTION.field_definition_file" )

diff --git a/tests/base.py b/tests/base.py
index a9d3f84..2d52079 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -20,7 +20,9 @@ class BasicRoverlayTestCase ( unittest.TestCase ):
       # does nothing if already initialized
       if cls.CONFIG is None:
          roverlay.setup_initial_logger()
-         cls.CONFIG = roverlay.load_config_file ( cls.CONFIG_FILE )
+         cls.CONFIG = roverlay.load_config_file (
+            cls.CONFIG_FILE, setup_logger=False
+         )
    # --- end of load_config (...) ---
 
 #   @classmethod


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/, tests/
  2013-07-10 16:16 [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/, tests/ André Erdmann
@ 2013-07-10 16:16 ` André Erdmann
  0 siblings, 0 replies; 2+ messages in thread
From: André Erdmann @ 2013-07-10 16:16 UTC (permalink / raw
  To: gentoo-commits

commit:     176e55595664470938e81c75c6544bbec361442b
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jul 10 16:13:59 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jul 10 16:13:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=176e5559

roverlay/__init__.py: make logger setup optional

---
 roverlay/__init__.py | 12 +++++++-----
 tests/base.py        |  4 +++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/roverlay/__init__.py b/roverlay/__init__.py
index cd93ba1..7930c4a 100644
--- a/roverlay/__init__.py
+++ b/roverlay/__init__.py
@@ -30,16 +30,17 @@ def setup_initial_logger():
    """Sets up initial logging."""
    roverlay.recipe.easylogger.setup_initial()
 
-def load_config_file ( cfile, extraconf=None ):
+def load_config_file ( cfile, extraconf=None, setup_logger=True ):
    """
    Loads the config, including the field definition file.
    Sets up the logger afterwards.
    (Don't call this method more than once.)
 
    arguments:
-   * cfile     -- path to the config file
-   * extraconf -- a dict with additional config entries that will override
-                  entries read from cfile
+   * cfile        -- path to the config file
+   * extraconf    -- a dict with additional config entries that will override
+                      entries read from cfile
+   * setup_logger -- set up logger (defaults to True)
    """
    roverlay_config = roverlay.config.access()
 
@@ -51,7 +52,8 @@ def load_config_file ( cfile, extraconf=None ):
    if extraconf is not None:
       roverlay_config.merge_with ( extraconf )
 
-   roverlay.recipe.easylogger.setup ( roverlay_config )
+   if setup_logger:
+      roverlay.recipe.easylogger.setup ( roverlay_config )
 
    confloader.load_field_definition (
       roverlay_config.get_or_fail ( "DESCRIPTION.field_definition_file" )

diff --git a/tests/base.py b/tests/base.py
index a9d3f84..2d52079 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -20,7 +20,9 @@ class BasicRoverlayTestCase ( unittest.TestCase ):
       # does nothing if already initialized
       if cls.CONFIG is None:
          roverlay.setup_initial_logger()
-         cls.CONFIG = roverlay.load_config_file ( cls.CONFIG_FILE )
+         cls.CONFIG = roverlay.load_config_file (
+            cls.CONFIG_FILE, setup_logger=False
+         )
    # --- end of load_config (...) ---
 
 #   @classmethod


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-10 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 16:16 [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/, tests/ André Erdmann
2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox