blendfile: ignore built-in fonts

also add filepath_absolute, readonly property
This commit is contained in:
2014-11-28 16:58:45 +01:00
parent 1cd189ec18
commit aae6de1af3

View File

@@ -95,6 +95,17 @@ class FPElem:
def filepath(self, filepath):
self._set_cb(filepath)
@property
def filepath_absolute(self):
filepath = self.filepath
if filepath.startswith(b'//'):
return os.path.join(
self.basedir,
utils.compatpath(filepath[2:]),
)
else:
return utils.compatpath(filepath)
class FPElem_block_path(FPElem):
"""
@@ -409,7 +420,8 @@ class FilePath:
def _from_block_VF(block, basedir, extra_info, level):
if block[b'packedfile']:
return
yield FPElem_block_path(basedir, level, (block, b'name')), extra_info
if block[b'name'] != b'<builtin>': # builtin font
yield FPElem_block_path(basedir, level, (block, b'name')), extra_info
@staticmethod
def _from_block_SO(block, basedir, extra_info, level):