maposmatic-dev
[Top][All Lists]
Advanced

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

[Maposmatic-dev] [PATCH] Change how the configuration files path are pas


From: Thomas Petazzoni
Subject: [Maposmatic-dev] [PATCH] Change how the configuration files path are passed to OCitySMap
Date: Fri, 6 Aug 2010 15:36:56 +0200

Instead of having to pass a list, we can now also pass just a single
string or None, in which case a default set of config file paths will
be tried.

Signed-off-by: Thomas Petazzoni <address@hidden>
---
 ocitysmap2/__init__.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ocitysmap2/__init__.py b/ocitysmap2/__init__.py
index 3e0365c..17858a0 100644
--- a/ocitysmap2/__init__.py
+++ b/ocitysmap2/__init__.py
@@ -132,10 +132,15 @@ class OCitySMap:
 
     STYLESHEET_REGISTRY = []
 
-    def __init__(self, config_files=['/etc/ocitysmap.conf', 
'~/.ocitysmap.conf'],
+    def __init__(self, config_files=None,
                  grid_table_prefix=None):
         """..."""
 
+        if config_files is None:
+            config_files = ['/etc/ocitysmap.conf', '~/.ocitysmap.conf']
+        elif not isinstance(config_files, list):
+            config_files = [config_files]
+
         config_files = map(os.path.expanduser, config_files)
         l.info('Reading OCitySMap configuration from %s...' %
                  ', '.join(config_files))
-- 
1.7.0.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]