Did I find the right examples for you? yes no

All Samples(13)  |  Call(13)  |  Derive(0)  |  Import(0)
Load configuration from string, returning a dictionary.

Load configuration from string buf. If pedantic is True,
un-loadable elements will raise TypeError exceptions instead of
being silently dropped. On success, return a dictionary containing
the parsed built-in objects, indexed by assignment names. On
error, raise a SyntaxError, TypeError or ValueError exception.

        def load(buf, pedantic=False):
    """
    Load configuration from string, returning a dictionary.

    Load configuration from string buf. If pedantic is True,
    un-loadable elements will raise TypeError exceptions instead of
    being silently dropped. On success, return a dictionary containing
    the parsed built-in objects, indexed by assignment names. On
    error, raise a SyntaxError, TypeError or ValueError exception.
    """
    return _Load()(buf, pedantic)
        


src/m/i/miniconf-1.2.0/test_miniconf.py   miniconf(Download)
    def test_empty(self):
        # Test empty load
        data = miniconf.load('')
        self.assertEqual(data, {})
 
    def test_comment_trimming(self):
        # Test empty load
        data = miniconf.load('# Nothing to see there, move along')
    def test_unloadable_structure(self):
        # Test on unloadable object
        data = miniconf.load(self.src_unloadable)
        self.assertEqual(data, {})
 
    def test_trivial_load(self):
        # Try to load a trivial value
        data = miniconf.load('spam = 1')
        self.assertEqual(data, {'spam': 1})
 
    def test_all_around_flat_load(self):
        # Test the load a single value of each supported type
        for value in (dict(), list(), tuple(),
                      int(), float(), str(), unicode(), bool(), None):
            data = miniconf.load('spam = %s' % repr(value))