File: tools.py

package info (click to toggle)
python-sievelib 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: python: 3,531; makefile: 7; sh: 5
file content (11 lines) | stat: -rw-r--r-- 309 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
"""Some tools."""

from typing import List


def to_list(stringlist: str, unquote: bool = True) -> List[str]:
    """Convert a string representing a list to real list."""
    stringlist = stringlist[1:-1]
    return [
        string.strip('"') if unquote else string for string in stringlist.split(",")
    ]