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.12.tar.gz (69.1 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.12-py3-none-any.whl (78.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nanohub_uidl-0.1.12.tar.gz
  • Upload date:
  • Size: 69.1 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.12.tar.gz
Algorithm Hash digest
SHA256 9f589262dd2d22eb2358ac329ff900e6628fd31c6c60deedbd49fb78617baa56
MD5 521266a5bdb413bc1e12aeb5e6bb452f
BLAKE2b-256 06255724d5cc3ebbdfc074f9dfb7643114fa62637b7090e8633edc8bacbbbe29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nanohub_uidl-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 78.4 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4a06632ac0417620e2d146547af2e22ac7ba4a5cf28620af0301da71a949c3f8
MD5 0e0ff80c85ac7a862c438ac5dcd95d4d
BLAKE2b-256 8f00e889d4d2363103a69f9d7e35234eedbd3ec1a7b38d038a4dd008577f282e

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