metadata refactoring

This commit is contained in:
Kenneth Reitz
2010-05-16 15:43:04 -04:00
parent 7449c634e1
commit 3bedd1d269
6 changed files with 31 additions and 10 deletions
+6
View File
@@ -1,6 +1,12 @@
History
=======
0.1.2 (2010-05-16)
------------------
* URL Generation BugFix
* Updated versioning
* Metadata refactoring
0.1.1 (2010-05-16)
------------------
+5 -1
View File
@@ -1,3 +1,7 @@
# encoding: utf-8
from gistapi import *
from gistapi import *
__author__ = 'Kenneth Reitz'
__version__ = '.'.join(('0', '1', '2'))
__license__ = 'MIT'
+3 -8
View File
@@ -34,11 +34,6 @@ import urllib
try: import simplejson as json
except ImportError: import json
__author__ = 'Kenneth Reitz'
__version__ = ('0', '1', '1')
__license__ = 'MIT'
class Gist(object):
"""Gist Object"""
@@ -71,9 +66,9 @@ class Gist(object):
_meta_url = 'http://gist.github.com/api/v1/json/{0}'.format(self.id)
_meta = json.load(urllib.urlopen(_meta_url))['gists'][0]
self.url = 'http://github.com/{0}'.format(id)
self.embed_url = 'http://github.com/{0}.js'.format(id)
self.json_url = 'http://github.com/{0}.json'.format(id)
self.url = 'http://github.com/{0}'.format(self.id)
self.embed_url = 'http://github.com/{0}.js'.format(self.id)
self.json_url = 'http://github.com/{0}.json'.format(self.id)
for key, value in _meta.iteritems():
+3 -1
View File
@@ -3,6 +3,8 @@
import os
import sys
import gistapi
from distutils.core import setup
@@ -15,7 +17,7 @@ if sys.argv[-1] == "publish":
sys.exit()
setup(name='gistapi',
version='0.1.1',
version=gistapi.__version__,
description='Python wrapper for Gist API',
long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
author='Kenneth Reitz',
+7
View File
@@ -0,0 +1,7 @@
from gistapi import *
for gist in Gists.fetch_by_user('defunkt'):
if gist.description == 'A list of Gist clients.':
print gist.id
print gist.repo
print gist.embed_url
+7
View File
@@ -0,0 +1,7 @@
from gistapi import *
for gist in Gists.fetch_by_user('defunkt'):
if gist.description == 'A list of Gist clients.':
print gist.id
print gist.repo
print gist.embed_url