Script Container

SourceElement

class canlib.canlib.SourceElement(name, contents)
contents

Alias for field number 1

name

Alias for field number 0

Txe

class canlib.canlib.Txe(path)[source]

The Txe class provides an interface to compiled t programs (.txe) files.

New in version 1.6.

compiler_version

t compiler version number.

Type:VersionNumber
date

Compilation date and time.

Type:datetime.datetime
description

t program description.

Type:str
file_version

.txe binary format version number.

Type:VersionNumber
is_encrypted

true if the source and byte-code sections of the .txe binary have been encrypted.

Type:bool
path

Path of compiled t program (.txe) file.

Type:str
size_of_code

Size in bytes of byte-code section.

Type:int
source

Yields name and content of the source files used to create the .txe binary file.

If the t source files used to create the .txe binary was included at compilation time, then this attribute will yield SourceElement tuples containing the name and content of the individual source files.

Sample usage:

for name, contents in txe.source:
  print('file name:{} contents:{}'.format(name, contents))

If the source and byte-code sections of the .txe binary have been encrypted then it’s not possible to parse the source list and a TxeFileIsEncrypted exception will be raised.

If no source files have been included in the .txe binary then an empty iterator is returned.

Yields:SourceElement – Name and contents tuple.
Raises:TxeFileIsEncrypted – If the source and byte-code sections of the .txe binary have been encrypted.