File: tools.py

package info (click to toggle)
python-sievelib 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 388 kB
  • sloc: python: 3,677; makefile: 7
file content (11 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (2)
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(",")
    ]