• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zostera / django-icons / 3649953237

pending completion
3649953237

push

github

GitHub
Bump actions/setup-python from 4.3.0 to 4.3.1

47 of 51 branches covered (92.16%)

Branch coverage included in aggregate %.

212 of 215 relevant lines covered (98.6%)

3.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/django_icons/css.py
1
def _merge_css_item(item):
4✔
2
    """Transform argument into a list with a single string value."""
3
    if isinstance(item, (list, tuple)):
4✔
4
        return _merge_css_list(*item)
4✔
5
    item = f"{item}" if item else ""
4✔
6
    return [item]
4✔
7

8

9
def _merge_css_list(*args):
4✔
10
    """Transform arguments into a list of string values."""
11
    css_list = []
4✔
12
    for arg in args:
4✔
13
        css_list += _merge_css_item(arg)
4✔
14
    return css_list
4✔
15

16

17
def merge_css_list(*args):
4✔
18
    """
19
    Combine a series of strings and lists into a single list of unique CSS classes.
20

21
    Removes duplicates. Gives precedence to first class encountered.
22
    """
23
    css_string = " ".join(_merge_css_list(*args))  # Create single string
4✔
24
    css_list = css_string.split()  # Split it to remove all whitespace
4✔
25
    css_list = filter(None, css_list)  # Remove empty strings
4✔
26
    # Remove duplicates, see https://stackoverflow.com/questions/480214/
27
    return list(dict.fromkeys(css_list))
4✔
28

29

30
def merge_css_text(*args):
4✔
31
    """
32
    Combine a series of strings and lists into one space separated string of unique CSS classes.
33

34
    Removes duplicates. Gives precedence to first class encountered.
35
    """
36
    return " ".join(merge_css_list(*args))
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc