|
|
@ -21,6 +21,7 @@ import datetime
|
|
|
|
import functools
|
|
|
|
import functools
|
|
|
|
import itertools
|
|
|
|
import itertools
|
|
|
|
import subprocess
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
import unicodedata
|
|
|
|
import urllib.parse
|
|
|
|
import urllib.parse
|
|
|
|
from http.cookiejar import Cookie
|
|
|
|
from http.cookiejar import Cookie
|
|
|
|
from email.utils import mktime_tz, parsedate_tz
|
|
|
|
from email.utils import mktime_tz, parsedate_tz
|
|
|
@ -209,6 +210,10 @@ def to_string(value):
|
|
|
|
return ", ".join(map(str, value))
|
|
|
|
return ", ".join(map(str, value))
|
|
|
|
return str(value)
|
|
|
|
return str(value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def remove_invisible_chars_strip(text):
|
|
|
|
|
|
|
|
"""Remove all invisible characters from 'text' then strip"""
|
|
|
|
|
|
|
|
return "".join(c for c in text if unicodedata.category(c)[0] != "C").strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def datetime_to_timestamp(dt):
|
|
|
|
def datetime_to_timestamp(dt):
|
|
|
|
"""Convert naive UTC datetime to timestamp"""
|
|
|
|
"""Convert naive UTC datetime to timestamp"""
|
|
|
|