Skip to content

Median-XL/pympq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pympq

Implementation of the StormLib API in python

Installation

pip install pympq

API Implementation Coverage

✔️ SFileOpenArchive
✔️ SFileCreateArchive
❌ SFileCreateArchive2
✔️ SFileAddListFile
❌ SFileSetLocale
❌ SFileGetLocale
❌ SFileFlushArchive
✔️ SFileCloseArchive
✔️ SFileGetMaxFileCount
✔️ SFileSetMaxFileCount
❌ SFileSignArchive Bugged
✔️ SFileCompactArchive
❌ SFileSetCompactCallback

❌ SFileOpenPatchArchive
❌ SFileIsPatchedArchive

✔️ SFileOpenFileEx
✔️ SFileGetFileSize
❌ SFileSetFilePointer
❌ SFileReadFile
✔️ SFileCloseFile
✔️ SFileHasFile
✔️ SFileGetFileName
❌ SFileGetFileInfo
✔️ SFileVerifyFile
❌ SFileVerifyArchive
✔️ SFileExtractFile

❌ SFileFindFirstFile
❌ SFileFindNextFile
❌ SFileFindClose
❌ SListFileFindFirstFile
❌ SListFileFindNextFile
❌ SListFileFindClose
❌ SFileEnumLocales

❌ SFileCreateFile
❌ SFileWriteFile
❌ SFileFinishFile
✔️ SFileAddFileEx
✔️ SFileRemoveFile
✔️ SFileRenameFile
❌ SFileSetFileLocale
❌ SFileSetAddFileCallback

❌ SCompImplode
❌ SCompExplode
❌ SCompCompress
❌ SCompDecompress

Examples

Create new mpq and add file to it

import pympq

with open("test.txt", "w") as f:
    f.write("hello world")

mpq_flags = [pympq.MPQ_CREATE_LISTFILE, pympq.MPQ_CREATE_ARCHIVE_V1]

with pympq.create_archive("test.mpq", mpq_flags, 128) as mpq:
    compress_flags = []
    file_flags = [pympq.MPQ_FILE_IMPLODE, pympq.MPQ_FILE_REPLACEEXISTING]
    mpq.add_file("test.txt", "path/in/mpq/test.txt", file_flags, compress_flags, [pympq.MPQ_COMPRESSION_NEXT_SAME])
    mpq.compact()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published