Convert basestring to str

Type basestring doesnt exist in python3 anymore
This commit is contained in:
lovetox 2016-09-25 23:21:51 +02:00
parent c126d36d6b
commit 93b1284fa5
3 changed files with 8 additions and 8 deletions

View File

@ -146,7 +146,7 @@ class DataField(ExtendedNode):
return t return t
def fset(self, value): def fset(self, value):
assert isinstance(value, basestring) assert isinstance(value, str)
self.setAttr('type', value) self.setAttr('type', value)
return locals() return locals()
@ -160,7 +160,7 @@ class DataField(ExtendedNode):
return self.getAttr('var') return self.getAttr('var')
def fset(self, value): def fset(self, value):
assert isinstance(value, basestring) assert isinstance(value, str)
self.setAttr('var', value) self.setAttr('var', value)
def fdel(self): def fdel(self):
@ -180,7 +180,7 @@ class DataField(ExtendedNode):
return l return l
def fset(self, value): def fset(self, value):
assert isinstance(value, basestring) assert isinstance(value, str)
self.setAttr('label', value) self.setAttr('label', value)
def fdel(self): def fdel(self):
@ -198,7 +198,7 @@ class DataField(ExtendedNode):
return self.getTagData('desc') or '' return self.getTagData('desc') or ''
def fset(self, value): def fset(self, value):
assert isinstance(value, basestring) assert isinstance(value, str)
if value == '': if value == '':
fdel(self) fdel(self)
else: else:
@ -351,7 +351,7 @@ class StringField(DataField):
return self.getTagData('value') or '' return self.getTagData('value') or ''
def fset(self, value): def fset(self, value):
assert isinstance(value, basestring) assert isinstance(value, str)
if value == '' and not self.required: if value == '' and not self.required:
return fdel(self) return fdel(self)
self.setTagData('value', value) self.setTagData('value', value)

View File

@ -31,8 +31,8 @@ class GroupsPostWindow:
Open new 'create post' window to create message for groupid on servicejid Open new 'create post' window to create message for groupid on servicejid
service service
""" """
assert isinstance(servicejid, basestring) assert isinstance(servicejid, str)
assert isinstance(groupid, basestring) assert isinstance(groupid, str)
self.account = account self.account = account
self.servicejid = servicejid self.servicejid = servicejid

View File

@ -315,7 +315,7 @@ class HashDigest:
sa, sd = self.algo, self.digest sa, sd = self.algo, self.digest
if isinstance(other, self.__class__): if isinstance(other, self.__class__):
oa, od = other.algo, other.digest oa, od = other.algo, other.digest
elif isinstance(other, basestring): elif isinstance(other, str):
sa, oa, od = None, None, self.cleanID(other) sa, oa, od = None, None, self.cleanID(other)
elif isinstance(other, tuple) and len(other) == 2: elif isinstance(other, tuple) and len(other) == 2:
oa, od = self.cleanID(other[0]), self.cleanID(other[1]) oa, od = self.cleanID(other[0]), self.cleanID(other[1])