File: util.py

package info (click to toggle)
python-drizzle 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 203,192 kB
  • sloc: ansic: 6,927; python: 2,054; makefile: 128
file content (34 lines) | stat: -rw-r--r-- 811 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Module ``util`` has been deprecated.
"""
import warnings

warnings.warn(
    "Module 'drizzle.util' has been deprecated since version 2.0.0 "
    "and it will be removed in a future release. "
    "Please replace calls to 'util.is_blank()' with alternative "
    "implementation.",
    DeprecationWarning
)


def is_blank(value):
    """
    Determines whether or not a value is considered 'blank'.

    Parameters
    ----------
    value : str
        The value to check

    Returns
    -------
    True or False
    """
    warnings.warn(
        "'is_blank()' has been deprecated since version 2.0.0 "
        "and it will be removed in a future release. "
        "Please replace calls to 'is_blank()' with alternative implementation.",
        DeprecationWarning
    )
    return value.strip() == ""