dss.IZIP#

Module Contents#

Classes#

IZIP

ZIP allows controlling the ZIP-compressed file functions from AltDSS/DSS C-API.

API#

class dss.IZIP.IZIP(api_util, prefer_lists=False)#

Bases: dss._cffi_api_util.Base

ZIP allows controlling the ZIP-compressed file functions from AltDSS/DSS C-API.

It allows opening a ZIP file, and loading circuits directly from it, without requiring extracting the contents to files before reading.

The implementation provides a specialization which allows more efficient access if the ZIP file is open and reused for many circuits. Doing so reduces the overhead of the initial opening and indexing of the file contents.

(API Extension)

Close()#

Closes the current open ZIP file

(API Extension)

Contains(Name: AnyStr) bool#

Check if the given path name is present in the current ZIP file.

(API Extension)

Extract(FileName: AnyStr) bytes#

Extracts the contents of the file “FileName” from the current (open) ZIP file. Returns a byte-string.

(API Extension)

List(regexp: Optional[AnyStr] = None) List[str]#

List of strings consisting of all names match the regular expression provided in regexp. If no expression is provided, all names in the current open ZIP are returned.

See https://regex.sorokin.engineer/en/latest/regular_expressions.html for information on the expression syntax and options.

(API Extension)

Open(FileName: AnyStr)#

Opens and prepares a ZIP file to be used by the DSS text parser. Currently, the ZIP format support is limited by what is provided in the Free Pascal distribution. Besides that, the full filenames inside the ZIP must be shorter than 256 characters. The limitations should be removed in a future revision.

(API Extension)

Redirect(FileInZip: AnyStr)#

Runs a “Redirect” command inside the current (open) ZIP file. In the current implementation, all files required by the script must be present inside the ZIP, using relative paths. The only exceptions are memory-mapped files.

(API Extension)

__contains__(Name) bool#
__getitem__(FileName) bytes#
__init__(api_util, prefer_lists=False)#