# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# -----------------------------------------------------------------------------
"""Task allowing to use a while statement.
"""
from __future__ import (division, unicode_literals, print_function,
absolute_import)
from atom.api import (Unicode, set_default)
from ..validators import Feval
from ..base_tasks import ComplexTask
from .loop_exceptions import BreakException, ContinueException
from ..decorators import handle_stop_pause
[docs]class WhileTask(ComplexTask):
""" Task breaking out of a loop when a condition is met.
See Python break statement documenttaion.
"""
#: Condition under which to continue looping.
condition = Unicode().tag(pref=True, feval=Feval())
database_entries = set_default({'index': 1})