Main Module

Pulls everything together.

class joy.vui.main.FileFaker(log)[source]

Pretends to be a file object but writes to log instead.

write(text)[source]

Write text to log.

joy.vui.main.error_guard(loop, n=10)[source]

Run a loop function, retry for n exceptions. Prints tracebacks on sys.stderr.

joy.vui.main.init()[source]

Initialize the system.

  • Init PyGame
  • Create main window
  • Start the PyGame clock
  • Set the event mask
  • Create the PersistTask
joy.vui.main.init_context(screen, clock, pt)[source]

More initialization

  • Create the Joy dictionary
  • Create the Display
  • Open the log, menu, and scratch text viewers, and the stack pickle
  • Start the main loop
  • Create the World object
  • Register PersistTask and World message handlers with the Display
  • Load user function definitions.
joy.vui.main.load_definitions(pt, dictionary)[source]

Load definitions from definitions.txt.

joy.vui.main.load_primitives(home, name_space)[source]

Load primitives from library.py.

joy.vui.main.main(screen, clock, pt)[source]

Main function.

  • Call init_context()
  • Load primitives
  • Create an evaluate function that lets you just eval some Python code
  • Redirect stdout to the log using a FileFaker object, and…
  • Start the main loop.