Commits

holger krekel committed 4116d19

merge new iniconfig

Comments (0)

Files changed (4)

 
 (c) Holger Krekel and others, 2004-2010
 """
-__version__ = '2.0.0.dev3'
+__version__ = '2.0.0.dev4'
 
 from py import _apipkg
 
 """ brain-dead simple parser for ini-style files.
 (C) Ronny Pfannschmidt, Holger Krekel -- MIT licensed
 """
-__version__ = "0.2.dev0"
+__version__ = "0.2.dev2"
 
 __all__ = ['IniConfig', 'ParseError']
 
         self.config = config
         self.name = name
 
+    def lineof(self, name):
+        return self.config.lineof(self.name, name)
+
     def get(self, key, default=None, convert=str):
         return self.config.get(self.name, key, convert=convert, default=default)
 
         long_description = long_description,
         install_requires=['py>=1.3.9', ], # force newer py version which removes 'py' namespace
         #                                  # so we can occupy it
-        version='2.0.0.dev3',
+        version='2.0.0.dev4',
         url='http://pylib.org',
         license='MIT license',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

testing/test_iniconfig.py

 import py
-from py.iniconfig import IniConfig, ParseError
+from py._iniconfig import IniConfig, ParseError, __all__ as ALL
 from textwrap import dedent
 
 def pytest_generate_tests(metafunc):
     assert config.lineof('section2') == 3
     assert config.lineof('section', 'value') == 2
     assert config.lineof('section2','value') == 5
+    
+    assert config['section'].lineof('value') == 2
+    assert config['section2'].lineof('value') == 5
 
 def test_iniconfig_get_convert():
     config= IniConfig("x", data='[section]\nint = 1\nfloat = 1.1')
     assert ['repository', 'username', 'password'] == list(other)
 
 
+def test_api_import():
+    assert ALL == ['IniConfig', 'ParseError']