Ran update-copyright.py
[hooke.git] / hooke / config.py
index ea5b2e4f9e262891721e656ceb158fb583041792..141cf5757520c4e7f74de4d1963e4db0e8792991 100644 (file)
@@ -1,20 +1,19 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
-# Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """Configuration defaults, read/write, and template file creation for
 Hooke.
@@ -106,7 +105,7 @@ DEFAULT_SETTINGS = [
     Setting('logger_hooke', 'qualname', 'hooke'),
     Setting('handler_hand1', help='Configure the default log handler, see\nhttp://docs.python.org/library/logging.html#configuration-file-format', wrap=False),
     Setting('handler_hand1', 'class', 'StreamHandler'),
-    Setting('handler_hand1', 'level', 'NOTSET'),
+    Setting('handler_hand1', 'level', 'WARN'),
     Setting('handler_hand1', 'formatter', 'form1'),
     Setting('handler_hand1', 'args', '(sys.stderr,)'),
     Setting('formatter_form1', help='Configure the default log formatter, see\nhttp://docs.python.org/library/logging.html#configuration-file-format', wrap=False),
@@ -137,7 +136,8 @@ class HookeConfigParser (configparser.RawConfigParser):
     >>> c = HookeConfigParser(default_settings=DEFAULT_SETTINGS)
     >>> c.write(sys.stdout) # doctest: +ELLIPSIS
     # Default environmental conditions in case they are not specified in
-    # the force curve data.
+    # the force curve data.  Configuration options in this section are
+    # available to every plugin.
     [conditions]
     # Temperature in Kelvin
     temperature = 301
@@ -161,7 +161,7 @@ class HookeConfigParser (configparser.RawConfigParser):
     ...         Setting(section, option='my float', value=3.14159, type='float'),
     ...         ])
     >>> pprint.pprint(c.items(section))  # doctest: +ELLIPSIS
-    [('my string', 'Lorem ipsum'),
+    [('my string', u'Lorem ipsum'),
      ('my bool', True),
      ('my int', 13),
      ('my float', 3.1415...)]
@@ -170,7 +170,7 @@ class HookeConfigParser (configparser.RawConfigParser):
     to use the standard `.get*()` methods.
 
     >>> c.get('test conversion', 'my bool')
-    'True'
+    u'True'
     >>> c.getboolean('test conversion', 'my bool')
     True
     """
@@ -233,7 +233,7 @@ class HookeConfigParser (configparser.RawConfigParser):
                     self._config_paths.append(filename)
         # Can't use super() because RawConfigParser is a classic class
         #return super(HookeConfigParser, self).read(filenames)
-        return configparser.RawConfigParser.read(self, filenames)
+        return configparser.RawConfigParser.read(self, self._config_paths)
 
     def _write_setting(self, fp, section=None, option=None, value=None,
                        **kwargs):