[models] Add missing flags to FileManifests

This commit is contained in:
derrod 2020-04-28 15:55:19 +02:00
parent 8251db22d2
commit 2eac83f6d1
2 changed files with 11 additions and 1 deletions

View file

@ -136,7 +136,9 @@ class JSONFML(FML):
_fm = FileManifest()
_fm.filename = _fmj.pop('Filename', '')
_fm.hash = blob_to_num(_fmj.pop('FileHash')).to_bytes(160//8, 'little')
_fm.flags = int(_fmj.pop('bIsUnixExecutable', False)) << 2
_fm.flags |= int(_fmj.pop('bIsReadOnly', False))
_fm.flags |= int(_fmj.pop('bIsCompressed', False)) << 1
_fm.flags |= int(_fmj.pop('bIsUnixExecutable', False)) << 2
_fm.file_size = 0
_fm.chunk_parts = []
_fm.install_tags = _fmj.pop('InstallTags', list())

View file

@ -397,6 +397,14 @@ class FileManifest:
self.chunk_parts = []
self.file_size = 0
@property
def read_only(self):
return self.flags & 0x1
@property
def compressed(self):
return self.flags & 0x2
@property
def executable(self):
return self.flags & 0x4