Package httxlib :: Module httxoptions :: Class HttxOptions
[hide private]
[frames] | no frames]

Class HttxOptions

source code

           object --+    
                    |    
httxobject.HttxObject --+
                        |
                       HttxOptions

Class implementing a set of options per domain to be held by HttxLib connecting objects like HttxManager, HttxNetLocation and HttxConnection

Nested Classes [hide private]
  __metaclass__
Metaclass for HttxOptions to initialize the list of options on instantiation
Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
HttxOptions
__deepcopy__(self, memo)
Deepcopy support.
source code
HttxOptions
clone(self)
Alias for deepcopy, for consistency with the rest of objects
source code
 
update(self, **kwargs)
Given a set of keyword arguments update the value of options
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  auth = <httxlib.httxoptions.HttxOption object at 0x01C18288>
  authcache = <httxlib.httxoptions.HttxOption object at 0x01C18558>
  authhandler = <httxlib.httxoptions.HttxOption object at 0x01C1...
  authproxy = <httxlib.httxoptions.HttxOption object at 0x01C18148>
  authuser = <httxlib.httxoptions.HttxOption object at 0x01C18210>
  autodecompression = <httxlib.httxoptions.HttxOption object at ...
  cacert = <httxlib.httxoptions.HttxOption object at 0x01C18648>
  certkeyfile = <httxlib.httxoptions.HttxOption object at 0x01C1...
  certreq = <httxlib.httxoptions.HttxOption object at 0x01C185F8>
  compmethod = <httxlib.httxoptions.HttxOption object at 0x01C0F...
  compression = <httxlib.httxoptions.HttxOption object at 0x01C0...
  connkeepalive = <httxlib.httxoptions.HttxOption object at 0x01...
  cookiejar = <httxlib.httxoptions.HttxOption object at 0x01C180D0>
  cookies = <httxlib.httxoptions.HttxOption object at 0x01C184B8>
  decompmethods = <httxlib.httxoptions.HttxOption object at 0x01...
  decompression = <httxlib.httxoptions.HttxOption object at 0x01...
  externalredirect = <httxlib.httxoptions.HttxOption object at 0...
  httpconnect = <httxlib.httxoptions.HttxOption object at 0x01C0...
  httpsconnect = <httxlib.httxoptions.HttxOption object at 0x01C...
  keepalive = <httxlib.httxoptions.HttxOption object at 0x01C0F4E0>
  maxredirects = <httxlib.httxoptions.HttxOption object at 0x01C...
  passmanager = <httxlib.httxoptions.HttxOption object at 0x01C1...
  proxy = <httxlib.httxoptions.HttxOption object at 0x01C0F8C8>
  redirect = <httxlib.httxoptions.HttxOption object at 0x01C0FC38>
  rfc2616postredir = <httxlib.httxoptions.HttxOption object at 0...
  sendfullurl = <httxlib.httxoptions.HttxOption object at 0x01C0...
  timeout = <httxlib.httxoptions.HttxOption object at 0x01C0F648>
  useragent = <httxlib.httxoptions.HttxOption object at 0x01C0F9B8>
Instance Variables [hide private]
tuple
  • timeout Default value: 15 seconds Timeout for network operations
  • keepalive Default value: 90 seconds Timeout for HTTP keepalive
  • connkeepalive Default value: True Timeout for HTTP Send the 'Connection: Keep-Alive' header
  • httpsconnect Default value: True Use CONNECT for proxying HTTPS
  • httpconnect Default value: False Use CONNECT for proxying HTTP
  • sendfullurl Default value: False HTTP 1.1 allows this, but some servers may crash if they receive the full url
  • proxy Default value: None A dictionary of scheme:url tuples can be set to use proxy servers scheme can be * for any scheme or have the http/https values
  • compression Default value: False If True the body of a POST will be sent compressed. This is supported by very few servers
  • compmethod Default value: HttxCompressionSet('gzip') Method to use when sending compressed requests
  • decompression Default value: True Request compressed answers and decompress the body of an HTTP answer
  • autodecompression Default value: True Even if compression was not requested, decompressed answers that contain a compressed body
  • decompmethod Default value: HttxCompressionSet('gzip', 'deflate', 'bzip2') Methods to use when requesting compressed answers
  • useragent Default value: '' Sets the user agent header value
  • redirect Default value: True Allows or disallows redirection support
  • externalredirect Default value: True Allows or disallows external redirection support
  • maxredirect Default value: 3 Maximum number of redirects to follow
  • rfc2616postredir Default value: True If a redir after a post as specified in RFC 2616 should be followed
  • cookies Default value: True Allows or disallows cookie support
  • cookiejar Default value: HttxCookieJar For internal storage of cookies in a HttxOptions domain
  • auth Default value: True Allows or disallows authentication support
  • authuser Default value: True Allows or disallows www authentication support
  • authproxy Default value: True Allows or disallows proxy authentication support
  • authhandler Default value: None It can hold a reference to a function (or callable object) that accepts the following parameters:
    • authhandler(authurl, authschemes, authcachedata) authurl is the url that generated the authorization request authschemes is a dictionary. The keys contain the names of the authentication schemes the server supports. Each value is a dictionary or paramaters (ex: realm='My AuthRealm', where realm is the key and 'My AuthRealm' is the associated value)
    • The function has to return a tuple: (authscheme, authanswer, authcachedata) If either authscheme or authanswer happen to be None then the handler cannot handle authentication)

      authscheme contains the chosen scheme from the varios that may have been presented to the handler

      authanswer contains the answer to the authentication challenge

      authcachedata is a value that the handler may wish to store and will receive on next authentication challenges for the same url. If None is returned nothing will be stored

  • passmanager Default value: HttxPassManager Internal storage of username/password credentials for realm and urls
  • authcache Default value: HttxAuthCache Internal storage of authentication answers for reuse
  • certkeyfile Default value: HttxCertKeyManager Internal storage of certificate/private key pair of path to files containing the certificates and private keys for client validation Being empty at the beginning, no files will be used in client validation
  • certreq Default value: HttxCertReqManager Internal storage of requirement of validation for server certificates Being empty at the beginning, no validation will be performed
  • cacert Default value: HttxCACertManager Internal storage of root (chain of) certificates(s) for server certificate validation. Being empty at the beginning, no validation can be performed
defoptions = HttxOption('timeout', 15), HttxOption('keepalive'...
list of HttxOption definitions

Inherited from httxobject.HttxObject: lock

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor. It delegates construction to the base class HttxObject

Overrides: object.__init__

__deepcopy__(self, memo)

source code 

Deepcopy support.

Parameters:
  • memo (dict) - standard __deepcopy__ parameter to avoid circular references
Returns: HttxOptions
a cloned object

clone(self)

source code 

Alias for deepcopy, for consistency with the rest of objects

Returns: HttxOptions
a cloned object

update(self, **kwargs)

source code 

Given a set of keyword arguments update the value of options

Parameters:
  • kwargs (dict) - keyword args

Class Variable Details [hide private]

authhandler

Value:
<httxlib.httxoptions.HttxOption object at 0x01C18440>

autodecompression

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F878>

certkeyfile

Value:
<httxlib.httxoptions.HttxOption object at 0x01C185A8>

compmethod

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FD78>

compression

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F710>

connkeepalive

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F530>

decompmethods

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FCB0>

decompression

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F800>

externalredirect

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FE40>

httpconnect

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FBE8>

httpsconnect

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F5D0>

maxredirects

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FE90>

passmanager

Value:
<httxlib.httxoptions.HttxOption object at 0x01C18508>

rfc2616postredir

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0FF80>

sendfullurl

Value:
<httxlib.httxoptions.HttxOption object at 0x01C0F698>

Instance Variable Details [hide private]

defoptions

list of HttxOption definitions
Type:
tuple
  • timeout Default value: 15 seconds Timeout for network operations
  • keepalive Default value: 90 seconds Timeout for HTTP keepalive
  • connkeepalive Default value: True Timeout for HTTP Send the 'Connection: Keep-Alive' header
  • httpsconnect Default value: True Use CONNECT for proxying HTTPS
  • httpconnect Default value: False Use CONNECT for proxying HTTP
  • sendfullurl Default value: False HTTP 1.1 allows this, but some servers may crash if they receive the full url
  • proxy Default value: None A dictionary of scheme:url tuples can be set to use proxy servers scheme can be * for any scheme or have the http/https values
  • compression Default value: False If True the body of a POST will be sent compressed. This is supported by very few servers
  • compmethod Default value: HttxCompressionSet('gzip') Method to use when sending compressed requests
  • decompression Default value: True Request compressed answers and decompress the body of an HTTP answer
  • autodecompression Default value: True Even if compression was not requested, decompressed answers that contain a compressed body
  • decompmethod Default value: HttxCompressionSet('gzip', 'deflate', 'bzip2') Methods to use when requesting compressed answers
  • useragent Default value: '' Sets the user agent header value
  • redirect Default value: True Allows or disallows redirection support
  • externalredirect Default value: True Allows or disallows external redirection support
  • maxredirect Default value: 3 Maximum number of redirects to follow
  • rfc2616postredir Default value: True If a redir after a post as specified in RFC 2616 should be followed
  • cookies Default value: True Allows or disallows cookie support
  • cookiejar Default value: HttxCookieJar For internal storage of cookies in a HttxOptions domain
  • auth Default value: True Allows or disallows authentication support
  • authuser Default value: True Allows or disallows www authentication support
  • authproxy Default value: True Allows or disallows proxy authentication support
  • authhandler Default value: None It can hold a reference to a function (or callable object) that accepts the following parameters:
    • authhandler(authurl, authschemes, authcachedata) authurl is the url that generated the authorization request authschemes is a dictionary. The keys contain the names of the authentication schemes the server supports. Each value is a dictionary or paramaters (ex: realm='My AuthRealm', where realm is the key and 'My AuthRealm' is the associated value)
    • The function has to return a tuple: (authscheme, authanswer, authcachedata) If either authscheme or authanswer happen to be None then the handler cannot handle authentication)

      authscheme contains the chosen scheme from the varios that may have been presented to the handler

      authanswer contains the answer to the authentication challenge

      authcachedata is a value that the handler may wish to store and will receive on next authentication challenges for the same url. If None is returned nothing will be stored

  • passmanager Default value: HttxPassManager Internal storage of username/password credentials for realm and urls
  • authcache Default value: HttxAuthCache Internal storage of authentication answers for reuse
  • certkeyfile Default value: HttxCertKeyManager Internal storage of certificate/private key pair of path to files containing the certificates and private keys for client validation Being empty at the beginning, no files will be used in client validation
  • certreq Default value: HttxCertReqManager Internal storage of requirement of validation for server certificates Being empty at the beginning, no validation will be performed
  • cacert Default value: HttxCACertManager Internal storage of root (chain of) certificates(s) for server certificate validation. Being empty at the beginning, no validation can be performed
Value:
HttxOption('timeout', 15), HttxOption('keepalive', 90), HttxOption('co\
nnkeepalive', True), HttxOption('httpsconnect', True), HttxOption('htt\
pconnect', False), HttxOption('sendfullurl', False), HttxOption('proxy\
', None), HttxOption('compression', False), HttxOption('compmethod', H\
ttxCompressionSet('gzip')), HttxOption('decompression', True), HttxOpt\
ion('autodecompression', True), HttxOption('decompmethods', HttxCompre\
ssionSet('gzip', 'deflate', 'bzip2')), HttxOption('useragent', ''), Ht\
txOption('redirect', True), HttxOption('externalredirect', True), Httx\
...