[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master 08/10] Add backwards compatibility code



Signed-off-by: Mark Hymers <mhy@debian.org>
---
 daklib/daklog.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/daklib/daklog.py b/daklib/daklog.py
index a3b9b02..d4c7867 100644
--- a/daklib/daklog.py
+++ b/daklib/daklog.py
@@ -40,7 +40,14 @@ class Logger(object):
         self.__dict__ = self.__shared_state
 
         if not getattr(self, 'initialised', False):
+            from daklib.config import Config
             self.initialised = True
+
+            # To be backwards compatibile, dump the first argument if it's a
+            # Config object.  TODO: Fix up all callers and remove this
+            if len(args) > 0 and isinstance(args[0], Config):
+                args.pop(0)
+
             self.__setup(*args, **kwargs)
 
 
-- 
1.7.2.5



Reply to: