tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mozversion.rst (1861B)


      1 :mod:`mozversion` --- Get application information
      2 =================================================
      3 
      4 `mozversion <https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozversion>`_
      5 provides version information such as the application name and the changesets
      6 that it has been built from. This is commonly used in reporting or for
      7 conditional logic based on the application under test.
      8 
      9 API Usage
     10 ---------
     11 
     12 .. automodule:: mozversion
     13    :members: get_version
     14 
     15 Examples
     16 ````````
     17 
     18 Firefox::
     19 
     20    import mozversion
     21 
     22    version = mozversion.get_version(binary='/path/to/firefox')
     23    for (key, value) in sorted(version.items()):
     24        if value:
     25            print '%s: %s' % (key, value)
     26 
     27 Firefox for Android::
     28 
     29    version = mozversion.get_version(binary='path/to/firefox.apk')
     30    print version['application_changeset'] # gets hg revision of build
     31 
     32 Command Line Usage
     33 ------------------
     34 
     35 mozversion comes with a command line program, ``mozversion`` which may be used to
     36 get version information from an application.
     37 
     38 Usage::
     39 
     40    mozversion [options]
     41 
     42 Options
     43 ```````
     44 
     45 ---binary
     46 '''''''''
     47 
     48 This is the path to the target application binary or .apk. If this is omitted
     49 then the current directory is checked for the existence of an
     50 application.ini file. If not found, then it is assumed the target
     51 application is a remote Firefox OS instance.
     52 
     53 Examples
     54 ````````
     55 
     56 Firefox::
     57 
     58    $ mozversion --binary=/path/to/firefox-bin
     59    application_buildid: 20131205075310
     60    application_changeset: 39faf812aaec
     61    application_name: Firefox
     62    application_repository: http://hg.mozilla.org/releases/mozilla-release
     63    application_version: 26.0
     64    platform_buildid: 20131205075310
     65    platform_changeset: 39faf812aaec
     66    platform_repository: http://hg.mozilla.org/releases/mozilla-release
     67 
     68 Firefox for Android::
     69 
     70    $ mozversion --binary=/path/to/firefox.apk