bugfix
This commit is contained in:
parent
028861a6e7
commit
f4dbdf04f3
47
bricks/init.py
Normal file
47
bricks/init.py
Normal file
@ -0,0 +1,47 @@
|
||||
def UiWindow(title, icon, content, cheight=10, cwidth=15):
|
||||
return {
|
||||
"widgettype":"PopupWindow",
|
||||
"options":{
|
||||
"author":"cc",
|
||||
"cwidth":cwidth,
|
||||
"cheight":cheight,
|
||||
"title":title,
|
||||
"content":content,
|
||||
"icon":icon or entire_url('/bricks/imgs/app.png'),
|
||||
"movable":True,
|
||||
"auto_open":True
|
||||
}
|
||||
}
|
||||
|
||||
def UiError(title="出错", message="出错啦", timeout=5):
|
||||
return {
|
||||
"widgettype":"Error",
|
||||
"options":{
|
||||
"author":"tr",
|
||||
"timeout":timeout,
|
||||
"cwidth":15,
|
||||
"cheight":10,
|
||||
"title":title,
|
||||
"message":message
|
||||
}
|
||||
}
|
||||
|
||||
def UiMessage(title="消息", message="后台消息", timeout=5):
|
||||
return {
|
||||
"widgettype":"Message",
|
||||
"options":{
|
||||
"author":"tr",
|
||||
"timeout":timeout,
|
||||
"cwidth":15,
|
||||
"cheight":10,
|
||||
"title":title,
|
||||
"message":message
|
||||
}
|
||||
}
|
||||
|
||||
def load_pybricks():
|
||||
g = ServerEnv()
|
||||
g.UiWindow = UiWindow
|
||||
g.UiError = UiError
|
||||
g.UiMessage = UiMessage
|
||||
|
18
pyproject.toml
Normal file
18
pyproject.toml
Normal file
@ -0,0 +1,18 @@
|
||||
[project]
|
||||
name="bricks"
|
||||
version = "0.0.2"
|
||||
description = "bricks components for server side"
|
||||
authors = [{ name = "yu moqing", email = "yumoqing@gmail.com" }]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
license = {text = "MIT"}
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest", "black", "mypy"]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=61", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
Loading…
Reference in New Issue
Block a user