Skip to main content

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


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.13.tar.gz (69.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanohub_uidl-0.1.13-py3-none-any.whl (78.6 kB view details)

Uploaded Python 3

File details

Details for the file nanohub_uidl-0.1.13.tar.gz.

File metadata

  • Download URL: nanohub_uidl-0.1.13.tar.gz
  • Upload date:
  • Size: 69.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_uidl-0.1.13.tar.gz
Algorithm Hash digest
SHA256 83e6b257a5b42e10a124a3922b9d85a4d736c84cecced21cb7246200b0e95eb5
MD5 bd2fc6640b998b4226e01ec62460e327
BLAKE2b-256 db9c6e0b2351402e18effc566617aa243b81bb269065abd8cfa88a404ca53ce3

See more details on using hashes here.

File details

Details for the file nanohub_uidl-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: nanohub_uidl-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 78.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for nanohub_uidl-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 e56845febee335c6dc73e433f3de6993c9b269c9cd8fb1ad64052a10915ee3b9
MD5 672ab6833e34c56e9755c0e699fd6b73
BLAKE2b-256 827f3ca8c3e4cab818281e657d0ee352a4d2c97a8912d5c6c2d16b9421ad31e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page