dom/bindings/mach_commands.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
     5 from __future__ import unicode_literals
     7 import os
     8 import sys
    10 from mach.decorators import (
    11     CommandArgument,
    12     CommandProvider,
    13     Command,
    14 )
    16 from mozbuild.base import MachCommandBase
    19 @CommandProvider
    20 class WebIDLProvider(MachCommandBase):
    21     @Command('webidl-example', category='misc',
    22         description='Generate example files for a WebIDL interface.')
    23     @CommandArgument('interface', nargs='+',
    24         help='Interface(s) whose examples to generate.')
    25     def webidl_example(self, interface):
    26         from mozwebidlcodegen import BuildSystemWebIDL
    28         manager = self._spawn(BuildSystemWebIDL).manager
    29         for i in interface:
    30             manager.generate_example_files(i)
    32     @Command('webidl-parser-test', category='testing',
    33         description='Run WebIDL tests.')
    34     @CommandArgument('--verbose', '-v', action='store_true',
    35         help='Run tests in verbose mode.')
    36     def webidl_test(self, verbose=False):
    37         sys.path.insert(0, os.path.join(self.topsrcdir, 'other-licenses',
    38             'ply'))
    40         from runtests import run_tests
    41         return run_tests(None, verbose=verbose)

mercurial