return new class for each ox.API call

This commit is contained in:
j 2013-11-02 17:40:01 +01:00
parent d38da54a17
commit 714729fee7

View file

@ -13,8 +13,8 @@ from .form import MultiPartForm
__all__ = ['API'] __all__ = ['API']
def API(url, cj=None):
class API(object): class API(object):
__version__ = 0.0 __version__ = 0.0
__name__ = 'ox' __name__ = 'ox'
DEBUG = False DEBUG = False
@ -104,3 +104,6 @@ class API(object):
if data: if data:
form.add_field('data', json.dumps(data)) form.add_field('data', json.dumps(data))
return self._json_request(self.url, form) return self._json_request(self.url, form)
return API(url, cj)