summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2020-04-14 14:21:25 +0200
committerTobias Brox <tobias@redpill-linpro.com>2020-04-14 14:21:25 +0200
commit1621aca6f83144db22823eb6b2e2943c49c5a6ed (patch)
treefced4f54c26efae3ac1a9c0d31231dca127c3bd2
parent03f9e707eb1c74cc71ef30dad4b0fe3f70359fd0 (diff)
downloadcalendar-cli-1621aca6f83144db22823eb6b2e2943c49c5a6ed.zip
apparently the to_normal_str function was added to caldav after the latest 0.6.2-release
-rwxr-xr-xcalendar-cli.py10
-rw-r--r--setup.py3
2 files changed, 11 insertions, 2 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index 5c30498..cb46912 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -35,7 +35,15 @@ import sys
import re
import urllib3
from getpass import getpass
-from caldav.lib.python_utilities import to_normal_str
+from six import PY3
+
+def to_normal_str(text):
+ if PY3 and text and not isinstance(text, str):
+ text = text.decode('utf-8')
+ elif not PY3 and text and not isinstance(text, str):
+ text = text.encode('utf-8')
+ return text
+
## ref https://github.com/tobixen/calendar-cli/issues/33, python3-compatibility
try:
diff --git a/setup.py b/setup.py
index a843a49..e3299b3 100644
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,8 @@ setup(
'icalendar',
'caldav>=0.5.0',
'pytz',
- 'tzlocal'
+ 'tzlocal',
+ 'six'
],
**metadata
)