summaryrefslogtreecommitdiffstats
path: root/pykolab/xml
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2022-03-13 20:31:19 +0100
committerChristoph Erhardt <kolab@sicherha.de>2022-03-13 20:31:38 +0100
commit1aeaee3ca41aa909bf994032ddae2d8d1592054e (patch)
treec8e518a3dee1a4405e1f041ed255f3fb6b18650e /pykolab/xml
parent4284cf68711b43f5702c375951eb00ff98143f00 (diff)
downloadpykolab-1aeaee3ca41aa909bf994032ddae2d8d1592054e.tar.gz
[Python 3]basestring to six string_types
Summary: Using for compatibility from six import string_types and "string_types" for "basestring" as it is still used in pykolab/utils.py Reviewers: #pykolab, #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3403
Diffstat (limited to 'pykolab/xml')
-rw-r--r--pykolab/xml/contact.py6
-rw-r--r--pykolab/xml/event.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/pykolab/xml/contact.py b/pykolab/xml/contact.py
index 7b0a2a7..9a6fd99 100644
--- a/pykolab/xml/contact.py
+++ b/pykolab/xml/contact.py
@@ -1,3 +1,5 @@
+from six import string_types
+
import kolabformat
import datetime
import pytz
@@ -133,13 +135,13 @@ class Contact(kolabformat.Contact):
return [x for x in self.emailAddresses()]
def set_email(self, email, preferred_index=0):
- if isinstance(email, basestring):
+ if isinstance(email, string_types):
self.setEmailAddresses([email], preferred_index)
else:
self.setEmailAddresses(email, preferred_index)
def add_email(self, email):
- if isinstance(email, basestring):
+ if isinstance(email, string_types):
self.add_emails([email])
elif isinstance(email, list):
self.add_emails(email)
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index a80fe20..3b4fb29 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -1,3 +1,5 @@
+from six import string_types
+
import datetime
import icalendar
import kolabformat
@@ -394,7 +396,7 @@ class Event(object):
return attendee.get_participant_status()
def get_attendee(self, attendee):
- if isinstance(attendee, basestring):
+ if isinstance(attendee, string_types):
if attendee in [x.get_email() for x in self.get_attendees()]:
attendee = self.get_attendee_by_email(attendee)
@@ -892,7 +894,7 @@ class Event(object):
getattr(self, default_setter)(value)
def set_ical_attendee(self, _attendee):
- if isinstance(_attendee, basestring):
+ if isinstance(_attendee, string_types):
_attendee = [_attendee]
if isinstance(_attendee, list):