[ufoLib] rename deprecated fs.setbytes -> writebytes

Follow up of #1445
Fixes #1424
This commit is contained in:
Cosimo Lupo 2019-01-15 11:07:04 +00:00
parent f47fee933c
commit 42ab9aba57
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482
2 changed files with 4 additions and 4 deletions

View File

@ -175,7 +175,7 @@ class _UFOBaseIO(object):
)
if self.fs.exists(fileName) and data == self.fs.readbytes(fileName):
return
self.fs.setbytes(fileName, data)
self.fs.writebytes(fileName, data)
else:
with self.fs.openbin(fileName, mode="w") as fp:
try:
@ -1009,12 +1009,12 @@ class UFOWriter(UFOReader):
if self.fs.isfile(path) and data == self.fs.readbytes(path):
return
try:
self.fs.setbytes(path, data)
self.fs.writebytes(path, data)
except fs.errors.FileExpected:
raise UFOLibError("A directory exists at '%s'" % path)
except fs.errors.ResourceNotFound:
self.fs.makedirs(fs.path.dirname(path), recreate=True)
self.fs.setbytes(path, data)
self.fs.writebytes(path, data)
def getFileObjectForPath(self, path, mode="w", encoding=None):
"""

View File

@ -423,7 +423,7 @@ class GlyphSet(_UFOBaseIO):
and data == self.fs.readbytes(fileName)
):
return
self.fs.setbytes(fileName, data)
self.fs.writebytes(fileName, data)
def deleteGlyph(self, glyphName):
"""Permanently delete the glyph from the glyph set on disk. Will