pywurfl.algorithms.wurfl.normalizers

Package pywurfl :: Package algorithms :: Package wurfl :: Module normalizers |
[hide private]
[frames] | no frames]

# Module normalizers

source code

This module contains the supporting classes for the Two Step Analysis user agent algorithm that is used as the primary way to match user agents with the Java API for the WURFL.

A description of the way the following source is intended to work can be found within the source for the original Java API implementation here: http://sourceforge.net/projects/wurfl/files/WURFL Java API/

The original Java code is GPLd and Copyright (c) 2008-2009 WURFL-Pro srl

Version: 1.0.1

Author: Armand Lynch <lyncha@users.sourceforge.net>

Copyright: Copyright 2010, Armand Lynch

License: LGPL

Functions | [hide private]
babelfish(user_agent) Replace the "via babelfish.yahoo.com" with '' | source code
blackberry(user_agent) Replaces the heading "BlackBerry" string with '' | source code
uplink(user_agent) Replace the trailing UP.Link ... | source code
vodafone(user_agent) Normalize the "/SNnnnnnnnnnnnnnnnn" String. | source code
yeswap(user_agent) Replace the "YesWAP mobile phone proxy" with '' | source code
ibm_wbi(user_agent) | source code
gmcc(user_agent) | source code
_combine_funcs(*funcs) | source code
default_normalizer(user_agent) | source code
_specific_normalizer(user_agent, search_string, vsn_size) | source code
chrome(user_agent) | source code
firefox(user_agent) | source code
konqueror(user_agent) | source code
opera(user_agent) | source code
msie(user_agent) | source code
android(user_agent) | source code
safari(user_agent) Return the safari user agent stripping out all the chararcters between U; and Safari/xxx | source code

Variables | [hide private]
| __doc__ = ``...``
| __url__ = ``'``http://celljam.net/``'``
| babel_fish_re = `re.compile(r'`(?u)`\s`*`\(via babelfish.yahoo.com\`...``
| uplink_re = `re.compile(r'`(?u)`\s`*`UP\.Link.`+`$')`
| vodafone_re = `re.compile(r'`(?u)`/SN`(`\d`+``)`\s')`
| yeswap_re = `re.compile(r'`(?u)`\s`*`Mozilla/4\.0 \(YesWAP mobile p`...``
| safari_re = `re.compile(r'`(?u)``(`Mozilla/5\.0.`*``)``(`;\s`*`U;.`*?``)``(`Safar`...``
| ibm_wbi_re = `re.compile(r'`(?u)`\(via IBM WBI \d`+`\.\d`+`\)')`
| gmcc_re = `re.compile(r'GMCC/\d\.\d')`

Function Details | [hide private]

### uplink(user_agent) | source code
Replace the trailing UP.Link ... with ''

### safari(user_agent) | source code
Return the safari user agent stripping out all the chararcters between U; and Safari/xxx e.g Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; fr) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18 becomes Mozilla/5.0 (Macintosh Safari/525

Variables Details | [hide private]

  ### __doc__ Value:
      """
      This module contains the supporting classes for the Two Step Analysis
      user agent
      algorithm that is used as the primary way to match user agents with th
      e Java API
      for the WURFL.

      A description of the way the following source is intended to work can
      ...

  ### babel_fish_re Value:
      re.compile(r'(?u)\s*\(via babelfish.yahoo.com\)\s*')

  ### yeswap_re Value:
      re.compile(r'(?u)\s*Mozilla/4\.0 \(YesWAP mobile phone proxy\)')

  ### safari_re Value:
      re.compile(r'(?u)(Mozilla/5\.0.*)(;\s*U;.*?)(Safari/\d{,3})')