Module rattlepy.environment : Rattle.py API Reference

Placeholder variables implementation

class rattlepy.environment.Environment

Holding values to replace placeholders. Threads have a separate set of variables.

THIS IS AN EXPERIMENTAL FEATURE.

Usage:

env = Environment()

with scaffold(createHeader("Page Title")) as html:
  with h1():
    # define a placeholder named 'title'
    text(env.define('title'))

env.title = 'Test Title'
# or
# env['title'] = 'Test Title'

print(html)

# finalizes on a certain thread.
env.dispose()
define(name)

Create a placeholder.

dispose()

Delete all data on the certain thread.

Placeholder class

class rattlepy.environment.placeholder.Placeholder(parent, name)

A class for placeholder in html node trees.

THIS IS AN EXPERIMENTAL FEATURE.