Fix /export
This commit is contained in:
parent
099d1d1c2c
commit
b245ff6e2d
1 changed files with 4 additions and 1 deletions
|
@ -243,11 +243,14 @@ class Roster(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
f = open(path, 'w+', encoding='utf-8')
|
f = open(path, 'w+', encoding='utf-8')
|
||||||
f.writelines([i + "\n" for i in self.contacts])
|
f.writelines([str(i) + "\n" for i in self.contacts if self[i] and (self[i].subscription == "both" or self[i].ask)])
|
||||||
f.close()
|
f.close()
|
||||||
return True
|
return True
|
||||||
except IOError:
|
except IOError:
|
||||||
return
|
return
|
||||||
|
except OSError:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def exists(self, contact):
|
def exists(self, contact):
|
||||||
if not contact:
|
if not contact:
|
||||||
|
|
Loading…
Reference in a new issue