Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Py93's variables

hasha2982 edited this page May 28, 2020 · 2 revisions

Py93 defines a JavaScript variable on Windows93 boot.

JavaScript variable $py93

Here goes a tree representation of $py93:

$py93
    ├ launchShell()
    └ shellGate
              ├ ignore (bool)
              └ pkgConts[strings] (array)

Variables explanation

Variable $py93

A global variable that contains Py93's JavaScript stuff.

Variable $py93.launchShell

A function that opens file /a/Py93/console.html using iframe.

Takes no parameters.

Source code:

$py93.launchShell = function() {
    $fs.utils.getMenuOpenWith('/a/Py93/console.html')[0].action();
}

Variable $py93.shellGate

A variable that contains stuff for shell.

Shell "exports" this variable using the following piece of code:

var gate = window.parent.$py93.shellGate

Then, it gets data from the gate variable, here's an example:

if (!gate.ignore) {
    // do this..
}

Variable $py93.shellGate.ignore

A boolean. If we don't need to load packages, (shell was launched with --packages-ignore or -pi option) this variable will be equal to true.

If not, then it's equal to false.

Variable $py93.shellGate.pkgConts

An array that contains contents of package files in strings.

After boot, it's completely empty. ([]) It gets filled on shell launching process. (even if option --packages-ignore or -pi is given, it's still fills)

On shell launching process, we're grabbing all files (and directories too) in /a/Py93/packages/ using $fs.utils.getFileMenu, and getting contents of every file which name ends with .brython.js using $db.getRaw, then pushing it to $py93.shellGate.pkgConts.

The shell gets the $py93.shellGate.pkgConts variable from window.parent, loops through the array using arr.forEach, and loads every string in the array using new Function(string_from_array)();

Reserved variables

Reserved variables are variables which name starts with r_Py93__.

Reserved variables currently (v1.1.2.1) used only in compiled files.