tools/include/device_utils.py
def send_signal_and_pull_files(signal,
                              outfiles_prefixes,
                              remove_outfiles_from_device,
                              out_dir,
                              optional_outfiles_prefixes=[]):
    '''Send a signal to the main B2G process and pull files created as a
    result.

    We send the given signal (which may be either a number of a string of the
    form 'SIGRTn', which we interpret as the signal SIGRTMIN + n) and pull the
    files generated into out_dir on the host machine.  We only pull files
    which were created after the signal was sent.

    When we're done, we remove the files from the device if
    remote_outfiles_from_device is true.

    outfiles_prefixes must be a list containing the beginnings of the files we
    expect to be created as a result of the signal.  For example, if we expect
    to see files named 'foo-XXX' and 'bar-YYY', we'd set outfiles_prefixes to
    ['foo-', 'bar-'].

    We expect to pull len(outfiles_prefixes) * (# b2g processes) files from the
    device.  If that succeeds, we then pull all files which match
    optional_outfiles_prefixes.

    '''
    (master_pid, child_pids) = get_remote_b2g_pids()
    old_files = _list_remote_temp_files(outfiles_prefixes)
    _send_remote_signal(signal, master_pid)

    all_outfiles_prefixes = outfiles_prefixes + optional_outfiles_prefixes

    num_expected_files = len(outfiles_prefixes) * (1 + len(child_pids))
    _wait_for_remote_files(outfiles_prefixes, num_expected_files, old_files)
    new_files = _pull_remote_files(all_outfiles_prefixes, old_files, out_dir)
    if remove_outfiles_from_device:
        _remove_files_from_device(all_outfiles_prefixes, old_files)
    return [os.path.basename(f) for f in new_files]
Send a signal to the main B2G process and pull files created as a
    result.

    We send the given signal (which may be either a number of a string of the
    form 'SIGRTn', which we interpret as the signal SIGRTMIN + n) and pull the
    files generated into out_dir on the host machine.  We only pull files
    which were created after the signal was sent.

    When we're done, we remove the files from the device if
    remote_outfiles_from_device is true.

    outfiles_prefixes must be a list containing the beginnings of the files we
    expect to be created as a result of the signal.  For example, if we expect
    to see files named 'foo-XXX' and 'bar-YYY', we'd set outfiles_prefixes to
    ['foo-', 'bar-'].

    We expect to pull len(outfiles_prefixes) * (# b2g processes) files from the
    device.  If that succeeds, we then pull all files which match
    optional_outfiles_prefixes.

    
Send a signal to the main B2G process and pull files created as a
result.

We send the given signal (which may be either a number of a string of the
form 'SIGRTn', which we interpret as the signal SIGRTMIN + n) and pull the
files generated into out_dir on the host machine.  We only pull files
which were created after the signal was sent.

When we're done, we remove the files from the device if
remote_outfiles_from_device is true.

outfiles_prefixes must be a list containing the beginnings of the files we
expect to be created as a result of the signal.

We expect to pull len(outfiles_prefixes) * (# b2g processes) files from the
device.  If that succeeds, we then pull all files which match
optional_outfiles_prefixes.
Send a signal to the main B2G process and pull files created as a result . We send the given signal ( which may be either a number of a string of the form ' SIGRTn ' which we interpret as the signal SIGRTMIN + n ) and pull the files generated into out_dir on the host machine . We only pull files which were created after the signal was sent . When we ' re done we remove the files from the device if remote_outfiles_from_device is true . outfiles_prefixes must be a list containing the beginnings of the files we expect to be created as a result of the signal . We expect to pull len ( outfiles_prefixes ) * ( # b2g processes ) files from the device . If that succeeds we then pull all files which match optional_outfiles_prefixes .
def send_signal_and_pull_files(signal,
                              outfiles_prefixes,
                              remove_outfiles_from_device,
                              out_dir,
                              optional_outfiles_prefixes=[]):
    (master_pid, child_pids) = get_remote_b2g_pids()
    old_files = _list_remote_temp_files(outfiles_prefixes)
    _send_remote_signal(signal, master_pid)
    all_outfiles_prefixes = outfiles_prefixes + optional_outfiles_prefixes
    num_expected_files = len(outfiles_prefixes) * (1 + len(child_pids))
    _wait_for_remote_files(outfiles_prefixes, num_expected_files, old_files)
    new_files = _pull_remote_files(all_outfiles_prefixes, old_files, out_dir)
    if remove_outfiles_from_device:
        _remove_files_from_device(all_outfiles_prefixes, old_files)
    return [os.path.basename(f) for f in new_files]
def send_signal_and_pull_files ( signal , outfiles_prefixes , remove_outfiles_from_device , out_dir , optional_outfiles_prefixes = [ ] ) : ( master_pid , child_pids ) = get_remote_b2g_pids ( ) old_files = _list_remote_temp_files ( outfiles_prefixes ) _send_remote_signal ( signal , master_pid ) all_outfiles_prefixes = outfiles_prefixes + optional_outfiles_prefixes num_expected_files = len ( outfiles_prefixes ) * ( 1 + len ( child_pids ) ) _wait_for_remote_files ( outfiles_prefixes , num_expected_files , old_files ) new_files = _pull_remote_files ( all_outfiles_prefixes , old_files , out_dir ) if remove_outfiles_from_device : _remove_files_from_device ( all_outfiles_prefixes , old_files ) return [ os . path . basename ( f ) for f in new_files ]
Send a signal to the main B2G process and pull files created as a
result.
Send a signal to the main B2G process and pull files created as a result .
'''Send a signal to the main B2G process and pull files created as a
    result.

    We send the given signal (which may be either a number of a string of the
    form 'SIGRTn', which we interpret as the signal SIGRTMIN + n) and pull the
    files generated into out_dir on the host machine.  We only pull files
    which were created after the signal was sent.

    When we're done, we remove the files from the device if
    remote_outfiles_from_device is true.

    outfiles_prefixes must be a list containing the beginnings of the files we
    expect to be created as a result of the signal.  For example, if we expect
    to see files named 'foo-XXX' and 'bar-YYY', we'd set outfiles_prefixes to
    ['foo-', 'bar-'].

    We expect to pull len(outfiles_prefixes) * (# b2g processes) files from the
    device.  If that succeeds, we then pull all files which match
    optional_outfiles_prefixes.

    '''
signal
outfiles_prefixes
remove_outfiles_from_device
out_dir
optional_outfiles_prefixes