mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[models] Add missing flags to FileManifests
This commit is contained in:
parent
8251db22d2
commit
2eac83f6d1
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue