dont break ox.API subclasses
This commit is contained in:
parent
714729fee7
commit
828223ad82
1 changed files with 88 additions and 85 deletions
15
ox/api.py
15
ox/api.py
|
@ -8,14 +8,19 @@ import gzip
|
|||
import StringIO
|
||||
import urllib2
|
||||
|
||||
from . import __version__
|
||||
from .utils import json
|
||||
from .form import MultiPartForm
|
||||
|
||||
__all__ = ['API']
|
||||
__all__ = ['getAPI', 'API']
|
||||
|
||||
def API(url, cj=None):
|
||||
class API(object):
|
||||
__version__ = 0.0
|
||||
def getAPI(url, cj=None):
|
||||
class A(API):
|
||||
pass
|
||||
return A(url, cj)
|
||||
|
||||
class API(object):
|
||||
__version__ = __version__
|
||||
__name__ = 'ox'
|
||||
DEBUG = False
|
||||
debuglevel = 0
|
||||
|
@ -105,5 +110,3 @@ def API(url, cj=None):
|
|||
form.add_field('data', json.dumps(data))
|
||||
return self._json_request(self.url, form)
|
||||
|
||||
return API(url, cj)
|
||||
|
||||
|
|
Loading…
Reference in a new issue