Skip to content

Commit

Permalink
incorrect readme rst
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseops committed Oct 31, 2016
1 parent e11cf90 commit f832a10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ YACT allows you to write human readable configuration files using YAML, then
load that configuration into your app without having to set up parsers, or
search for config files, or any of that nonsense. Even better, YACT can
automatically reload your configuration file when it detects the file has
changed.
changed.::

>>> config = yact.from_file('my-config.yaml', auto_reload=True)

YACT is tested against Python 2.7 & 3.3-3.5.
YACT is tested against Python 2.7, 3.3-3.6(dev) and PyPy.


Usage Guide
Expand Down
24 changes: 11 additions & 13 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,24 @@ Examples

::

import yact
config = yact.from_file('sample.conf')
isinstance(config, yact.Config)
>>> True
>>> import yact
>>> config = yact.from_file('sample.conf')
>>> assert isinstance(config, yact.Config)
True

**Modifying and saving:**

::

config.set('foo', 'bar')
print(config['foo'])
>>> 'bar'
config.save()
>>> config.set('foo', 'bar')
>>> print(config['foo'])
'bar'
>>> config.save()

**Dot notation for nested configs:**

::

config.set('this.is.nested', True)
print(config.get('this')['is']['nested'])
>>> True


>>> config.set('this.is.nested', True)
>>> print(config.get('this')['is']['nested'])
True

0 comments on commit f832a10

Please sign in to comment.