Pkg.XZ — API for parsing XZ archives

Overview

The Pkg.XZ module contains the API for parsing XZ archives.

Parsing an XZ Archive

The following code example demonstrates how to parse an XZ archive:

from Pro.Core import *
from Pkg.XZ import *

def parseXZArchive(fname):
    c = createContainerFromFile(fname)
    if c.isNull():
        return
    obj = XZObject()
    if not obj.Load(c) or not obj.ParseArchive():
        return
    # decompresses the archive
    decompressed = obj.Extract()

Module API

Pkg.XZ module API.

Classes:

XZObject()

This class represents an XZ archive.

class XZObject

Bases: Pro.Core.CFFObject

This class represents an XZ archive.

Methods:

Extract([c, wo])

Extracts the XZ archive.

ParseArchive()

Parses the archive.

Extract(c: Optional[Pro.Core.NTContainer] = None, wo: Optional[Pro.Core.NTIWait] = None)Pro.Core.NTContainer

Extracts the XZ archive.

Parameters
  • c (Optional[NTContainer]) – Optional destination container for the extracted data.

  • wo (Optional[NTIWait]) – Optional wait object for the extraction operation.

Returns

Returns the data if successful; otherwise returns an invalid container.

Return type

NTContainer

ParseArchive()bool

Parses the archive.

Returns

Returns True if successful; otherwise returns False.

Return type

bool

See also Extract().