Skip to main content

python page application framework

Project description

Python app framework

Installation

pip install app-page-core

Page页面属性

callback 回调管理对象 children 子页面管理对象 store 全局变量管理对象

Usage

应用首页,初始化全局对象,页面对象,加载页面 app.py

from app_page import Store, Page

def signal_slots_func(signal, id, func):
  # 绑定信号与槽函数
  print(signal, id, func)

# 初始化全局对象
Store({
  "version": "1.0.0",
  "isLogin": False,
  "functions": {
    # 信号与槽绑定函数"__signal_slots_func"
    "__signal_slots_func": signal_slots_func,
  },
})

# 初始化页面对象
page = Page()
page.setup('app.json')

配置页面结构 app.json

{
  "name": "main",
  "id": "id001",
  "style": "app.css",
  "children": "children/page.json",
  "events": {
    "clicked": {
      "btn1": "sendMessage",
      "btn2": "cancel"
    }
  },
  "functions": {
    "sendMessage": "functions/sendMessage.py",
    "cancel": "functions/cancel.py"
  }
}

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

app-page-core-0.0.2.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file app-page-core-0.0.2.tar.gz.

File metadata

  • Download URL: app-page-core-0.0.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for app-page-core-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b1c0252aec4c1cc741650434b03701710e3db0bdca60e71203a3602db483bbd7
MD5 b42b0d2c9aa69b2baf90b91d57a21c7e
BLAKE2b-256 7fff9b5659fb0faa0e70fdb36f24f251bec7050043b639f5b8da37e7cecacd82

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