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.2.0.tar.gz
(66.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nanohub_uidl-0.2.0.tar.gz.
File metadata
- Download URL: nanohub_uidl-0.2.0.tar.gz
- Upload date:
- Size: 66.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e0064563cb2671d0e866194b615f76767b19efc42b9c402a11bfb7027d3d85
|
|
| MD5 |
c94409241b964a3dddb0710e52adf805
|
|
| BLAKE2b-256 |
167a4b852fd5b93b37f31078683e4af30ce50f0db46ea0c5084c6ce3d29ce471
|
File details
Details for the file nanohub_uidl-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nanohub_uidl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 75.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb37e3482b669a3c9cd052e38db701d09c088b1d2554ffe8b3aae146db29f918
|
|
| MD5 |
7125e241a9395cebe66dd1c4116d0414
|
|
| BLAKE2b-256 |
56b2f9a662177447bb1565c5efc8e11891862442f897441ffd2e0279371c73ce
|