File: util.py

package info (click to toggle)
python-drizzle 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 203,404 kB
  • sloc: ansic: 8,489; python: 2,901; makefile: 128
file content (35 lines) | stat: -rw-r--r-- 814 bytes parent folder | download
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
35
"""
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() == ""