# watchme.tasks package

## Submodules

## watchme.tasks.worker module

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class `watchme.tasks.worker.``Workers`(workers=None, show_progress=False)

  Bases: `object`

  `end`()
  `run`(funcs, tasks)

    run will send a list of tasks, a tuple with arguments, through a function. the arguments should be ordered correctly.

    Parameters

      - funcs (the functions to run with multiprocessing.pool, a dictionary) – with lookup by the task name

      - tasks (a dict of tasks, each task name (key) with a) – tuple of arguments to process

  `start`()

`watchme.tasks.worker.``init_worker`()

`watchme.tasks.worker.``multi_package`(func, kwargs)

`watchme.tasks.worker.``multi_wrapper`(func_args)

## Module contents

Copyright (C) 2019 Vanessa Sochat.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

class `watchme.tasks.``TaskBase`(name, params=None, **kwargs)

  Bases: `object`

  `export_params`(active='true')

    export parameters, meaning returning a dictionary of the task parameters plus the addition of the task type and active status.

  `get_type`()

    get the watcher type.

  `run`()

    run an isolated task, meaning no update or communication with the watcher. This will return the raw result.

  `set_params`(params)

    iterate through parameters, set into dictionary.

    Parameters

      params (a list of key@value pairs to set.)

  `validate`()

    validate the parameters set for the Task. Exit if there are any errors. Ensure required parameters are defined, and have correct values.

  `write_results`(result, repo)

    an entrypoint function for a general task. By default, we parse results based on the result type. Any particular subclass of the TaskBase can modify or extend these functions.

    Parameters

      - result (the result object to parse)

      - repo (the repo base (watcher.repo))