The top level attributes (os
, version
, bits
, processor
) are available as module globals:
if mozinfo.os == 'win': ...
In addition, mozinfo exports a dictionary, mozinfo.info
, that contain these values. mozinfo also exports:
choices
: a dictionary of possible values for os, bits, and processormain
: the console_script entry point for mozinfounknown
: a singleton denoting a value that cannot be determinedunknown
has the string representation "UNKNOWN"
. unknown will evaluate as False
in python:
if not mozinfo.os: ... # unknown!
MozInfo comes with a command line, mozinfo
which may be used to diagnose one's current system.
Example output:
os: linux version: Ubuntu 10.10 bits: 32 processor: x86
Three of these fields, os, bits, and processor, have a finite set of choices. You may display the value of these choices using mozinfo --os
, mozinfo --bits
, and mozinfo --processor
. mozinfo --help
documents command-line usage.