Pancake Embed Plugin - 零 import 机制,将所有装饰器注入 builtins
Project description
Pancake Embed
零 import 插件 — 配合 DoughMeta 实现框架 API 自动注入
工作原理
- Embed 插件加载时(
init_order=-10,最先执行),将装饰器注册到muffin_flour - 用户定义
Dough子类时,DoughMeta 自动从muffin_flour/muffin_water注入已注册的名称到模块命名空间 - 用户代码无需
import即可使用所有装饰器和基类
from pancake.dough import Dough
# 定义子类后,Singleton、Service、DoughFactory 等自动可用
@Singleton
class UserService(Service):
async def on_init(self):
self.db = DoughFactory.get().resolve("DatabaseService")
注册的名称
装饰器 (muffin_flour)
@Singleton/@Prototype/@Lazy— 作用域@DoughDecorator— 标记类为 Bean@DependsOn("A", "B")— 声明依赖@Import(Cls)— 自动注册外部类@Maker/@noMaker— 控制方法 Bean 注册@inject— 自动注入依赖@Config— 从配置注入字段
基类 (muffin_water)
Configuration— 配置类Service— 服务类Function— 方法类Struct— 数据结构类DoughFactory— Bean 工厂
安装
pip install pancake-embed
或在 pancake.xml 中添加:
<dependency>
<groupId>io.pancake</groupId>
<artifactId>embed</artifactId>
</dependency>
开源协议
MIT
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
pancake_embed-0.1.0.tar.gz
(2.0 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 pancake_embed-0.1.0.tar.gz.
File metadata
- Download URL: pancake_embed-0.1.0.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
276b6d05b52989abdb5c41441cc781a1d7b488ed9a2dc177d68a406b6a8d342d
|
|
| MD5 |
70f68ee402f3d491b70ec7203e8eae19
|
|
| BLAKE2b-256 |
ebab9a5a0440a51b269c8d57708df2b569ccbcc6c142d2f2ac51b6b7456e0cb6
|
File details
Details for the file pancake_embed-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pancake_embed-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47cdcbdd1349533790bb13d08f9aa8a39c9d714e15cb9f10a24bb797ec9c9e51
|
|
| MD5 |
d45c17887693335e4571b9ff03b7635e
|
|
| BLAKE2b-256 |
e0b297ce88d9ce583f81c3369231c94ffd1bda5775e4a40c2a1ae6a6a0058cdd
|