Name

packet (script) — Replaced by script

Synopsis

Content Model
packet ::= (var*, text,
            tag*, packet*)
Attributes
See the general packet element documentation.

Deprecated since Regina 7.0

Description

In Regina 6.0.1 and earlier, the packet element was used to store every packet in the entire packet tree that makes up a Regina data file. This page describes how the packet element was structured when storing a script packet. Since Regina 7.0, each packet type has its own XML element; in particular, script packets are now stored using the script element.

A script packet stores a Python script offering direct low-level access to the Regina calculation engine.

A script may contain variables representing other packets in the same packet tree; these are described by the child var elements.

The way the Python code is stored has changed over time:

  • Between Regina 4.96 and Regina 6.0.1, the Python code was stored as a single text element.

  • In Regina 4.95 and earlier, the Python code was stored line-by-line using a sequence of line elements.

Both storage methods are still recognised by Regina when reading old second-generation data files.

If you are writing a second-generation data file that must be read by very old versions of Regina (dating back to Regina 4.95), then you may write the script twice: first as a series of line elements, and then again as a single text element. However, the line elements must come first, since when Regina reads a file it will append each line to the script, whereas if it sees a text element it will replace the script entirely. Therefore, if the line elements appear after the text element, Regina will effectively build two copies of the script end-on-end.

The roles played by the child tag and packet elements are described in the general packet element documentation.

Parents

The following elements contain packet: packet, reginadata.

Children

The following elements occur in packet for a script packet: packet, tag, text, var.