Package mobi :: Package mtld :: Package da :: Package device :: Module config :: Class Config
[hide private]
[frames] | no frames]

Class Config

object --+
         |
        Config

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
 
get_cookie_name(self)
Get the cookie name that the client side properties would be set to.
 
set_cookie_name(self, value)
To change the cookie name that the client side properties would be set to.
 
get_include_ua_props(self)
Get if the User-Agent properties should be included in the property set or not.
 
set_include_ua_props(self, value)
To disable or enable get_properties(HEADERS) including User-Agent dynamic properties.
 
get_include_lang_props(self)
Get if the language/locale properties should be included in the property set or not.
 
set_include_lang_props(self, value)
To disable or enable get_properties(HEADERS) including language and locale properties.
 
get_include_match_info(self)
To get if get_properties(HEADERS) should include the matched and unmatched parts of the User-Agent to the property set.
 
set_include_match_info(self, value)
To disable or enable get_properties(HEADERS) including the matched and unmatched parts of the User-Agent to the property set.
 
get_return_none_when_no_properties(self)
Get if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned
 
set_return_none_when_no_properties(self, value)
Set if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned.
 
get_max_cache_entries(self)
Get maximum number of allowed entries in cache.
 
set_max_cache_entries(self, value)
Set maximum number of allowed entries in cache.
 
is_cache_enabled(self)
Abstraction to make it easier to check if the cache is enabled on the DeviceApi instance.

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

Class Variables [hide private]
  DEFAULT_COOKIE_NAME = u'DAPROPS'
  DEFAULT_INCLUDE_UA_PROPS = True
  DEFAULT_INCLUDE_LANG_PROPS = True
  DEFAULT_INCLUDE_MATCH_INFO = False
  DEFAULT_RETURN_NONE_WHEN_NO_PROPERTIES = False
  DEFAULT_MAX_CACHE_ENTRIES = 4096
Properties [hide private]
  cookie_name
Get the cookie name that the client side properties would be set to.
  include_ua_props
Get if the User-Agent properties should be included in the property set or not.
  include_lang_props
Get if the language/locale properties should be included in the property set or not.
  include_match_info
To get if get_properties(HEADERS) should include the matched and unmatched parts of the User-Agent to the property set.
  return_none_when_no_properties
Get if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned
  max_cache_entries
Get maximum number of allowed entries in cache.

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_cookie_name(self)

 

Get the cookie name that the client side properties would be set to. When using DeviceApi get_properties(HEADERS) the detection will use this name to look for the cookie and use its contents if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.<br/> When the user-agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for get_properties(HEADERS).

:return: The cookie name which the client side properties are set to

set_cookie_name(self, value)

 

To change the cookie name that the client side properties would be set to. When using get_properties(HEADERS), the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.<br/> When the user-agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for get_properties(HEADERS). If you set the cookie-name to null then the client-side properties cookie will be ignored.

:param value: The cookie name which the client side properties are set to. Set to null to turn off using client-side properties :return:

get_include_ua_props(self)

 

Get if the User-Agent properties should be included in the property set or not.

:return: True = include ua properties

set_include_ua_props(self, value)

 

To disable or enable get_properties(HEADERS) including User-Agent dynamic properties. Some properties cannot be known before runtime and can change from User-Agent to User-Agent. The most common of these are the OS Version and the Browser Version. The DeviceApi is able to dynamically detect these changing properties with a small overhead. If these properties are not needed, the value for `include_ua_props` can be set to False to make the detection marginally faster.

:param value: True = include ua properties :return:

get_include_lang_props(self)

 

Get if the language/locale properties should be included in the property set or not.

:return: True = include lang properties

set_include_lang_props(self, value)

 

To disable or enable get_properties(HEADERS) including language and locale properties. To check the Accept-Language header and include properties to the property set for getting client's language and locale preferences set to true. If these properties are not needed, the value for `include_lang_props` can be set to False to make the detection marginally faster.

:param value: True = include lang properties :return:

get_include_match_info(self)

 

To get if get_properties(HEADERS) should include the matched and unmatched parts of the User-Agent to the property set.

:return: True = include match info properties

set_include_match_info(self, value)

 

To disable or enable get_properties(HEADERS) including the matched and unmatched parts of the User-Agent to the property set.

:param value: True = include match info properties :return:

get_return_none_when_no_properties(self)

 

Get if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned

:return: True = return None instead of empty Properties object

set_return_none_when_no_properties(self, value)

 

Set if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned.

:param value: True = return None instead of empty Properties object :return:

get_max_cache_entries(self)

 

Get maximum number of allowed entries in cache. :return:

set_max_cache_entries(self, value)

 

Set maximum number of allowed entries in cache. :param value: Expects an integer >=0, otherwise the value will not be set :return:

is_cache_enabled(self)

 

Abstraction to make it easier to check if the cache is enabled on the DeviceApi instance.

:return:


Property Details [hide private]

cookie_name

Get the cookie name that the client side properties would be set to. When using DeviceApi get_properties(HEADERS) the detection will use this name to look for the cookie and use its contents if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.<br/> When the user-agent or HTTP headers are set manually to get_properties() the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for get_properties(HEADERS).

:return: The cookie name which the client side properties are set to

Get Method:
get_cookie_name(self) - Get the cookie name that the client side properties would be set to.
Set Method:
set_cookie_name(self, value) - To change the cookie name that the client side properties would be set to.

include_ua_props

Get if the User-Agent properties should be included in the property set or not.

:return: True = include ua properties

Get Method:
get_include_ua_props(self) - Get if the User-Agent properties should be included in the property set or not.
Set Method:
set_include_ua_props(self, value) - To disable or enable get_properties(HEADERS) including User-Agent dynamic properties.

include_lang_props

Get if the language/locale properties should be included in the property set or not.

:return: True = include lang properties

Get Method:
get_include_lang_props(self) - Get if the language/locale properties should be included in the property set or not.
Set Method:
set_include_lang_props(self, value) - To disable or enable get_properties(HEADERS) including language and locale properties.

include_match_info

To get if get_properties(HEADERS) should include the matched and unmatched parts of the User-Agent to the property set.

:return: True = include match info properties

Get Method:
get_include_match_info(self) - To get if get_properties(HEADERS) should include the matched and unmatched parts of the User-Agent to the property set.
Set Method:
set_include_match_info(self, value) - To disable or enable get_properties(HEADERS) including the matched and unmatched parts of the User-Agent to the property set.

return_none_when_no_properties

Get if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned

:return: True = return None instead of empty Properties object

Get Method:
get_return_none_when_no_properties(self) - Get if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned
Set Method:
set_return_none_when_no_properties(self, value) - Set if the value returned by get_properties(HEADERS) should be None or an empty Properties object when there are no properties to be returned.

max_cache_entries

Get maximum number of allowed entries in cache. :return:

Get Method:
get_max_cache_entries(self) - Get maximum number of allowed entries in cache.
Set Method:
set_max_cache_entries(self, value) - Set maximum number of allowed entries in cache.