return new class for each ox.API call
This commit is contained in:
parent
d38da54a17
commit
714729fee7
1 changed files with 86 additions and 83 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue