Codebase list lazr.config / upstream/2.1
Import lazr.config_2.1.orig.tar.gz Barry Warsaw 9 years ago
14 changed file(s) with 49 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 1.1
11 Name: lazr.config
2 Version: 2.0.1
2 Version: 2.1
33 Summary: Create configuration schemas, and process and validate configurations.
44 Home-page: https://launchpad.net/lazr.config
55 Author: LAZR Developers
4141
4242 # General information about the project.
4343 project = u'lazr.config'
44 copyright = u'2013-2014, LAZR developers'
44 copyright = u'2013-2015, LAZR developers'
4545
4646 # The version info for the project you're documenting, acts as replacement for
4747 # |version| and |release|, also used in various other places throughout the
0 # Copyright 2008-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2008-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config.
33 #
1313 # You should have received a copy of the GNU Lesser General Public License
1414 # along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
1515
16 # This is a namespace package, however under >= Python 3.3, let it be a true
17 # namespace package (i.e. this cruft isn't necessary).
18 import sys
19
20 if sys.hexversion < 0x30300f0:
21 try:
22 import pkg_resources
23 pkg_resources.declare_namespace(__name__)
24 except ImportError:
25 import pkgutil
26 __path__ = pkgutil.extend_path(__path__, __name__)
16 # This is a namespace package.
17 try:
18 import pkg_resources
19 pkg_resources.declare_namespace(__name__)
20 except ImportError:
21 import pkgutil
22 __path__ = pkgutil.extend_path(__path__, __name__)
0 # Copyright 2007-2009 Canonical Ltd. All rights reserved.
0 # Copyright 2007-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config
33 #
0 # Copyright 2008-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2008-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config.
33 #
4040 import os
4141 import pwd
4242 import re
43 import sys
4344
4445 from os.path import abspath, basename, dirname
4546 from textwrap import dedent
571572 if confs is None:
572573 confs = []
573574 encoding_errors = self._verifyEncoding(conf_data)
574 parser = RawConfigParser()
575 # LP: #1397779. In Python 3, RawConfigParser grew a `strict` keyword
576 # option and in Python 3.2, this argument changed its default from
577 # False to True. This breaks behavior compatibility with Python 2, so
578 # under Python 3, always force strict=False.
579 kws = {}
580 if sys.version_info >= (3,):
581 kws['strict'] = False
582 parser = RawConfigParser(**kws)
575583 parser.readfp(StringIO(conf_data), conf_filename)
576584 confs.append((conf_filename, parser, encoding_errors))
577585 if parser.has_option('meta', 'extends'):
11 NEWS for lazr.config
22 ====================
33
4 2.1 (2015-01-05)
5 ================
6 - Always use old-style namespace package registration in ``lazr/__init__.py``
7 since the mere presence of this file subverts PEP 420 style namespace
8 packages. (LP: #1407816)
9 - For behavioral compatibility between Python 2 and 3, `strict=False` must be
10 passed to the underlying `RawConfigParser` under Python 3. (LP: #1397779)
411
512 2.0.1 (2014-08-22)
613 ==================
714 - Drop the use of `distribute` in favor of `setuptools`. (LP: #1359926)
815 - Run the test suite with `tox`.
9
1016
1117 2.0 (2013-01-10)
1218 ================
1420 - Now more strict in its requirement of ASCII in config files.
1521 - Category names are now sorted by default.
1622
17
1823 1.1.3 (2009-08-25)
1924 ==================
20
2125 - Fixed a build problem.
2226
2327 1.1.2 (2009-08-25)
2428 ==================
25
2629 - Got rid of a sys.path hack.
27
2830
2931 1.1.1 (2009-03-24)
3032 ==================
31
3233 - License clarification: only v3 of the LGPL is offered at this time, not
3334 subsequent versions.
34
3535 - Build is updated to support Sphinx docs and other small changes.
3636
3737 1.1 (2009-01-05)
3838 ================
39
4039 - Support for adding arbitrary sections in a configuration file, based on a
4140 .master section in the schema. The .master section allows admins to define
4241 configurations for an arbitrary number of processes. If the schema defines
4443 .master section. These are like categories with templates except that the
4544 section names extending .master need not be named in the schema file.
4645 [Bug 310619]
47
4846 - ConfigSchema now provides an interface for constructing the schema from a
4947 string. [Bug 309859]
50
5148 - Added as_boolean() and as_log_level() type converters. [Bug 310782]
52
5349 - getByCategory() accepts a default argument. If the category is missing, the
5450 default argument is returned. If the category is missing and no default
5551 argument is given, a NoCategoryError is raised, as before. [Bug 309988]
5652
57
5853 1.0 (2008-12-19)
5954 ================
60
6155 - Initial release
0 # Copyright 2009-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2009-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.smtptest
33 #
13371337 :glob:
13381338
13391339 *
1340 docs/*
13411340
13421341 .. _timedelta: http://docs.python.org/3/library/datetime.html#timedelta-objects
0 # Copyright 2009-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2009-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.smtptest
33 #
0 # Copyright 2007-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2007-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config
33 #
0 # Copyright 2008-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2008-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config.
33 #
202202 self.meq(config['section_33'].key2, """\
203203 multiline value 1
204204 multiline value 2""")
205
206 def test_lp1397779(self):
207 # Fix DuplicateSectionErrors when you .push() a config that has a
208 # section already defined in the config.
209 schema = ConfigSchema(self._testfile('base.conf'))
210 config = schema.load(self._testfile('local.conf'))
211 self.assertEqual(config['section_1']['key1'], 'foo')
212 config.push('dupsec', """\
213 [section_1]
214 key1: baz
215 [section_1]
216 key1: qux
217 """)
218 self.assertEqual(config['section_1']['key1'], 'qux')
00 Metadata-Version: 1.1
11 Name: lazr.config
2 Version: 2.0.1
2 Version: 2.1
33 Summary: Create configuration schemas, and process and validate configurations.
44 Home-page: https://launchpad.net/lazr.config
55 Author: LAZR Developers
0 # Copyright 2008-2014 Canonical Ltd. All rights reserved.
0 # Copyright 2008-2015 Canonical Ltd. All rights reserved.
11 #
22 # This file is part of lazr.config.
33 #
5656 'Programming Language :: Python :: 2.7',
5757 'Programming Language :: Python :: 3',
5858 ],
59 # nose plugins don't really work with `python setup.py test` so use
60 # `python setup.py nosetests` instead, or just `tox`. Gosh, we really
61 # should switch to nose2. :/ - BAW 2014-08-20
62 #test_suite='nose.collector',
6359 )