polar: add test for orger integration

This commit is contained in:
Dima Gerasimov 2020-05-15 09:52:18 +01:00
parent 0f27071dcc
commit 87ad9d38bb
2 changed files with 42 additions and 13 deletions

View file

@ -246,3 +246,10 @@ def isoparse(s: str) -> tzdatetime:
assert s.endswith('Z'), s
s = s[:-1] + '+00:00'
return fromisoformat(s)
import re
# https://stackoverflow.com/a/295466/706389
def get_valid_filename(s: str) -> str:
s = str(s).strip().replace(' ', '_')
return re.sub(r'(?u)[^-\w.]', '', s)