Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: third_party/mozinfo/README.md

Issue 108313011: Adding mozilla libraries required by Firefox interop test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/mozinfo/README.chromium ('k') | third_party/mozinfo/mozinfo/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Throughout [mozmill](https://developer.mozilla.org/en/Mozmill)
2 and other Mozilla python code, checking the underlying
3 platform is done in many different ways. The various checks needed
4 lead to a lot of copy+pasting, leaving the reader to wonder....is this
5 specific check necessary for (e.g.) an operating system? Because
6 information is not consolidated, checks are not done consistently, nor
7 is it defined what we are checking for.
8
9 [MozInfo](https://github.com/mozilla/mozbase/tree/master/mozinfo)
10 proposes to solve this problem. MozInfo is a bridge interface,
11 making the underlying (complex) plethora of OS and architecture
12 combinations conform to a subset of values of relavence to
13 Mozilla software. The current implementation exposes relavent key,
14 values: `os`, `version`, `bits`, and `processor`. Additionally, the
15 service pack in use is available on the windows platform.
16
17
18 # API Usage
19
20 MozInfo is a python package. Downloading the software and running
21 `python setup.py develop` will allow you to do `import mozinfo`
22 from python.
23 [mozinfo.py](https://github.com/mozilla/mozbase/blob/master/mozinfo/mozinfo.py)
24 is the only file contained is this package,
25 so if you need a single-file solution, you can just download or call
26 this file through the web.
27
28 The top level attributes (`os`, `version`, `bits`, `processor`) are
29 available as module globals:
30
31 if mozinfo.os == 'win': ...
32
33 In addition, mozinfo exports a dictionary, `mozinfo.info`, that
34 contain these values. mozinfo also exports:
35
36 - `choices`: a dictionary of possible values for os, bits, and
37 processor
38 - `main`: the console_script entry point for mozinfo
39 - `unknown`: a singleton denoting a value that cannot be determined
40
41 `unknown` has the string representation `"UNKNOWN"`. unknown will evaluate
42 as `False` in python:
43
44 if not mozinfo.os: ... # unknown!
45
46
47 # Command Line Usage
48
49 MozInfo comes with a command line, `mozinfo` which may be used to
50 diagnose one's current system.
51
52 Example output:
53
54 os: linux
55 version: Ubuntu 10.10
56 bits: 32
57 processor: x86
58
59 Three of these fields, os, bits, and processor, have a finite set of
60 choices. You may display the value of these choices using
61 `mozinfo --os`, `mozinfo --bits`, and `mozinfo --processor`.
62 `mozinfo --help` documents command-line usage.
OLDNEW
« no previous file with comments | « third_party/mozinfo/README.chromium ('k') | third_party/mozinfo/mozinfo/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698