OpenQuizz
Une application de gestion des contenus pédagogiques
UserAgent Class Reference
Inheritance diagram for UserAgent:
Collaboration diagram for UserAgent:

Public Member Functions

def __init__ (self, environ_or_string)
 
def to_header (self)
 
def __str__ (self)
 
def __nonzero__ (self)
 
def __repr__ (self)
 

Data Fields

 string
 
 language
 

Detailed Description

Represents a user agent.  Pass it a WSGI environment or a user agent
string and you can inspect some of the details from the user agent
string via the attributes.  The following attributes exist:

.. attribute:: string

   the raw user agent string

.. attribute:: platform

   the browser platform. ``None`` if not recognized.
   The following platforms are currently recognized:

   -   `aix`
   -   `amiga`
   -   `android`
   -   `blackberry`
   -   `bsd`
   -   `chromeos`
   -   `dragonflybsd`
   -   `freebsd`
   -   `hpux`
   -   `ipad`
   -   `iphone`
   -   `irix`
   -   `linux`
   -   `macos`
   -   `netbsd`
   -   `openbsd`
   -   `sco`
   -   `solaris`
   -   `symbian`
   -   `wii`
   -   `windows`

.. attribute:: browser

    the name of the browser. ``None`` if not recognized.
    The following browsers are currently recognized:

    -   `aol` *
    -   `ask` *
    -   `baidu` *
    -   `bing` *
    -   `camino`
    -   `chrome`
    -   `edge`
    -   `firefox`
    -   `galeon`
    -   `google` *
    -   `kmeleon`
    -   `konqueror`
    -   `links`
    -   `lynx`
    -   `mozilla`
    -   `msie`
    -   `msn`
    -   `netscape`
    -   `opera`
    -   `safari`
    -   `seamonkey`
    -   `webkit`
    -   `yahoo` *

    (Browsers marked with a star (``*``) are crawlers.)

.. attribute:: version

    the version of the browser. ``None`` if not recognized.

.. attribute:: language

    the language of the browser. ``None`` if not recognized.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  environ_or_string 
)

Member Function Documentation

◆ __nonzero__()

def __nonzero__ (   self)

◆ __repr__()

def __repr__ (   self)

◆ __str__()

def __str__ (   self)

◆ to_header()

def to_header (   self)

Field Documentation

◆ language

language

◆ string

string

The documentation for this class was generated from the following file: