Package intermine :: Module webservice :: Class InterMineURLOpener
[hide private]
[frames] | no frames]

Class InterMineURLOpener

source code

 urllib.URLopener --+    
                    |    
urllib.FancyURLopener --+
                        |
                       InterMineURLOpener

Specific implementation of urllib.FancyURLOpener for this client

Provides user agent and authentication headers, and handling of errors

Instance Methods [hide private]
 
__init__(self, credentials=None, token=None)
InterMineURLOpener((username, password)) → InterMineURLOpener
source code
 
post_plain_text(self, url, body) source code
 
open(self, url, data=None)
Use URLopener().open(file) instead of open(file, 'r').
source code
 
prepare_url(self, url) source code
 
delete(self, url) source code
 
http_error_default(self, url, fp, errcode, errmsg, headers)
Re-implementation of http_error_default, with content now supplied by default
source code
 
http_error_400(self, url, fp, errcode, errmsg, headers, data=None)
400 errors indicate that something about our request was incorrect
source code
 
http_error_401(self, url, fp, errcode, errmsg, headers, data=None)
401 errors indicate we don't have sufficient permission for the resource we requested - usually a list or a tempate
source code
 
http_error_404(self, url, fp, errcode, errmsg, headers, data=None)
404 errors indicate that the requested resource does not exist - usually a template that is not longer available.
source code
 
http_error_500(self, url, fp, errcode, errmsg, headers, data=None)
500 errors indicate that the server borked during the request - ie: it wasn't our fault.
source code

Inherited from urllib.FancyURLopener: get_user_passwd, http_error_301, http_error_302, http_error_303, http_error_307, http_error_407, prompt_user_passwd, redirect_internal, retry_http_basic_auth, retry_https_basic_auth, retry_proxy_http_basic_auth, retry_proxy_https_basic_auth

Inherited from urllib.URLopener: __del__, addheader, cleanup, close, http_error, open_data, open_file, open_ftp, open_http, open_https, open_local_file, open_unknown, open_unknown_proxy, retrieve

Class Variables [hide private]
  version = 'InterMine-Python-Client-0.96.00'
Method Details [hide private]

__init__(self, credentials=None, token=None)
(Constructor)

source code 

Constructor

InterMineURLOpener((username, password)) → InterMineURLOpener

Return a new url-opener with the appropriate credentials

Overrides: urllib.URLopener.__init__

open(self, url, data=None)

source code 

Use URLopener().open(file) instead of open(file, 'r').

Overrides: urllib.URLopener.open
(inherited documentation)

http_error_default(self, url, fp, errcode, errmsg, headers)

source code 

Re-implementation of http_error_default, with content now supplied by default

Overrides: urllib.URLopener.http_error_default

http_error_400(self, url, fp, errcode, errmsg, headers, data=None)

source code 

Handle 400 HTTP errors, attempting to return informative error messages

400 errors indicate that something about our request was incorrect

Raises:

http_error_401(self, url, fp, errcode, errmsg, headers, data=None)

source code 

Handle 401 HTTP errors, attempting to return informative error messages

401 errors indicate we don't have sufficient permission for the resource we requested - usually a list or a tempate

Raises:
Overrides: urllib.FancyURLopener.http_error_401

http_error_404(self, url, fp, errcode, errmsg, headers, data=None)

source code 

Handle 404 HTTP errors, attempting to return informative error messages

404 errors indicate that the requested resource does not exist - usually a template that is not longer available.

Raises:

http_error_500(self, url, fp, errcode, errmsg, headers, data=None)

source code 

Handle 500 HTTP errors, attempting to return informative error messages

500 errors indicate that the server borked during the request - ie: it wasn't our fault.

Raises: