Skip to content

Commit

Permalink
Merge pull request #11 from migueldvb/docs
Browse files Browse the repository at this point in the history
Instantiate magic.Magic by calling the class in the documentation
  • Loading branch information
aliles committed Feb 4, 2014
2 parents b3e430a + d93b148 commit 43628af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/guide_content
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To ensure that resources are correctly released by :class:`magic.Magic`, it's
necessary to either explicitly call :meth:`~magic.Magic.close` on instances,
or use ``with`` statement. ::

>>> with magic.Magic as m:
>>> with magic.Magic() as m:
... pass
...

Expand All @@ -69,15 +69,15 @@ exceptions.
To identify a file from it's filename, use the
:meth:`~magic.Magic.id_filename()` method. ::

>>> with magic.Magic as m:
>>> with magic.Magic() as m:
... m.id_filename('setup.py')
...
'Python script, ASCII text executable'

Similarily to identify a file from a string that has already been read, use the
:meth:`~magic.Magic.id_buffer` method. ::

>>> with magic.Magic as m:
>>> with magic.Magic() as m:
... m.id_buffer('#!/usr/bin/python\n')
...
'Python script, ASCII text executable'
Expand Down

0 comments on commit 43628af

Please sign in to comment.