A set of tools to run create Javascript Apps, using Teleporthq UIDL schema
Project description
Nanohub - UIDL
UIDL Stats
Latest Release | |
PyPI Downloads |
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 Distribution
nanohub-uidl-0.1.9.tar.gz
(64.8 kB
view details)
Built Distribution
File details
Details for the file nanohub-uidl-0.1.9.tar.gz
.
File metadata
- Download URL: nanohub-uidl-0.1.9.tar.gz
- Upload date:
- Size: 64.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8faa1433e51399fdc0121f9e5ea29aecfb2e8559eee0eb5953a4f4caaad045 |
|
MD5 | 2f29999d9304965e3132d6672bc7d33d |
|
BLAKE2b-256 | cc49b37cbf1dea910aae51ee51f2841dfbeb4cf1ab1814166a9b9b34c68c7e0a |
File details
Details for the file nanohub_uidl-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: nanohub_uidl-0.1.9-py3-none-any.whl
- Upload date:
- Size: 68.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ac95e48b93ee0fb7cbf94b353efdf47d6baf1394ee96ef8b3c77b68a4b5d0d0 |
|
MD5 | b4af0fab780fa37b711c7e0bf6a7f2f8 |
|
BLAKE2b-256 | 5f0aa06a721e32d5d5b31821b7404b19839659827f6cc69970331809922b2a57 |