A set of tools to run create Javascript Apps, using Teleporthq UIDL schema
Project description
Nanohub - UIDL
A set of tools to create Javascript apps to consume nanohub WS
Installation
pip install nanohub-uidl
Usage
from nanohubuidl.teleport import TeleportProject, TeleportElement
from nanohubuidl.material import MaterialContent
from nanohubuidl.auth import AUTH
Project = TeleportProject("My App")
Component = Project.root
Component.addStateVariable("myvariable", {"type":"boolean", "defaultValue": True})
STATE_LOADER_STATUS = "loader_status"
STATE_LOADER_OPEN = "loader_open"
STATE_ERROR_STATUS = "error_status"
STATE_ERROR_OPEN = "error_open"
Login, CLogin = Auth.Login(
Project,
Component,
client_id = "MYAPPID",
client_secret = "MYAPPSECRET",
url = "https://nanohub.org/api/developer/oauth/token",
open_state = STATE_LOGIN_OPEN
)
Login.content.events["onError"]=[
{ "type": "stateChange", "modifies": STATE_ERROR_OPEN, "newState": True},
{ "type": "stateChange", "modifies": STATE_ERROR_STATUS, "newState": '$e'},
]
Login.content.events["onAuth"] = [
{ "type": "stateChange", "modifies": STATE_ERROR_OPEN, "newState": False},
{ "type": "stateChange", "modifies": STATE_LOADER_OPEN, "newState": False},
]
Grid = t.TeleportElement(MaterialContent(elementType="Grid"))
Button= MaterialBuilder.Button(
title = "Reset Setting",
variant = "text",
onClickButton=[{ "type": "stateChange", "modifies": "parameters","newState": resetSettings}]
)
Grid.addContent(Button)
Component.addNode(Grid)
Project.buildReact("Myapp.html");
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for nanohub_uidl-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2cf5c95612450f9a1ca6f9e385288e5e4943350e870975c7299b956bbfb519 |
|
MD5 | 5dcbf32e3453da82ba03fcf79cb8bb17 |
|
BLAKE2b-256 | fee0f23aff057fbbe8b98001ddfed2d312c64411f3d5b87d6e1f42504cd931f9 |