From 6b4b41bba0a398a8aa62fc7e00427889bf3dd73a Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 2 Aug 2010 08:28:04 -0400 Subject: [PATCH] Cleaner readme example --- .project | 17 +++++++++++++++++ .pydevproject | 10 ++++++++++ .settings/org.eclipse.core.resources.prefs | 3 +++ README.rst | 2 +- gistapi/gistapi.py | 18 ++++++++++-------- 5 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 .project create mode 100644 .pydevproject create mode 100644 .settings/org.eclipse.core.resources.prefs diff --git a/.project b/.project new file mode 100644 index 0000000..dc53a28 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + GistAPI + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..9bdde2c --- /dev/null +++ b/.pydevproject @@ -0,0 +1,10 @@ + + + + +Default +python 2.6 + +/GistAPI/gistapi + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..a59e0e9 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Jun 23 13:47:22 EDT 2010 +eclipse.preferences.version=1 +encoding//gistapi/gistapi.py=utf-8 diff --git a/README.rst b/README.rst index 1191c4b..906dbc3 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ Example Usage :: - from gistapi import * + from gistapi import Gist, Gists gist = Gist('d4507e882a07ac6f9f92') gist.description # 'Example Gist for gist.py' diff --git a/gistapi/gistapi.py b/gistapi/gistapi.py index fa14636..97ce14d 100644 --- a/gistapi/gistapi.py +++ b/gistapi/gistapi.py @@ -8,28 +8,28 @@ GistAPI.py -- A Python wrapper for the Gist API Example usage: >>> Gist('d4507e882a07ac6f9f92').repo -u'd4507e882a07ac6f9f92' +'d4507e882a07ac6f9f92' >>> Gist('d4507e882a07ac6f9f92').owner -u'kennethreitz' +'kennethreitz' >>> Gist('d4507e882a07ac6f9f92').description -u'Example Gist for gist.py' +'Example Gist for gist.py' >>> Gist('d4507e882a07ac6f9f92').created_at -u'2010/05/16 10:51:15 -0700' +'2010/05/16 10:51:15 -0700' >>> Gist('d4507e882a07ac6f9f92').public False >>> Gist('d4507e882a07ac6f9f92').filenames -[u'exampleEmptyFile', u'exampleFile'] +['exampleEmptyFile', 'exampleFile'] >>> Gist('d4507e882a07ac6f9f92').files -{u'exampleFile': 'Example file content.', u'exampleEmptyFile': ''} +{'exampleFile': 'Example file content.', uexampleEmptyFile': ''} >>> Gists.fetch_by_user('kennethreitz')[-1].description -u'My .bashrc configuration' +'My .bashrc configuration' """ @@ -41,7 +41,6 @@ try: except ImportError: import json - __all__ = ['Gist', 'Gists'] @@ -126,4 +125,7 @@ class Gists(object): if __name__ == '__main__': import doctest + print('hello') + a = 'bob' + doctest.testmod()