faster-app 0.0.12__py3-none-any.whl → 0.0.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
faster_app/__init__.py CHANGED
@@ -9,7 +9,7 @@ Faster APP - 一个轻量级的 Python Web 框架
9
9
  - 数据库连接管理 (tortoise_init)
10
10
  """
11
11
 
12
- __version__ = "0.0.12"
12
+ __version__ = "0.0.13"
13
13
  __author__ = "peizhenfei"
14
14
  __email__ = "peizhenfei@hotmail.com"
15
15
 
@@ -12,18 +12,35 @@ class AppCommand(CommandBase):
12
12
  async def env(self):
13
13
  """Create .env file"""
14
14
  # 拷贝项目根路径下的 .env.example 文件到项目根路径
15
- shutil.copy(f"{self.BASE_PATH}/.env.example", ".env")
16
- console.print(".env created successfully")
15
+ try:
16
+ shutil.copy(f"{self.BASE_PATH}/.env.example", ".env")
17
+ console.print("✅ .env created successfully")
18
+ except FileExistsError:
19
+ console.print("✅ .env already exists")
20
+ except Exception as e:
21
+ console.print(f"❌ .env created failed: {e}")
17
22
 
18
23
  async def demo(self):
19
24
  """create demo app"""
20
25
  # 项目根路径下创建 apps 目录,如果存在则跳过
21
- if not os.path.exists("apps"):
22
- os.makedirs("apps")
23
- # 拷贝 templates/apps/demo 目录到 apps 目录
24
- shutil.copytree(f"{self.BASE_PATH}/templates/apps/demo", "apps/demo")
26
+ try:
27
+ if not os.path.exists("apps"):
28
+ os.makedirs("apps")
29
+ # 拷贝 templates/apps/demo 目录到 apps 目录
30
+ shutil.copytree(f"{self.BASE_PATH}/templates/apps/demo", "apps/demo")
31
+ console.print("✅ apps/demo created successfully")
32
+ except FileExistsError:
33
+ console.print("✅ apps/demo already exists")
34
+ except Exception as e:
35
+ console.print(f"❌ apps/demo created failed: {e}")
25
36
 
26
37
  async def config(self):
27
38
  """create config"""
28
39
  # 拷贝 templates/config 到 . 目录
29
- shutil.copytree(f"{self.BASE_PATH}/templates/config", ".")
40
+ try:
41
+ shutil.copytree(f"{self.BASE_PATH}/templates/config", "./config")
42
+ console.print("✅ config created successfully")
43
+ except FileExistsError:
44
+ console.print("✅ config already exists")
45
+ except Exception as e:
46
+ console.print(f"❌ config created failed: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: faster_app
3
- Version: 0.0.12
3
+ Version: 0.0.13
4
4
  Summary: 一个轻量级的 Python Web 框架,提供自动发现、模型基类、命令行工具等功能
5
5
  Author-email: peizhenfei <peizhenfei@hotmail.com>
6
6
  Maintainer-email: peizhenfei <peizhenfei@hotmail.com>
@@ -1,5 +1,5 @@
1
1
  faster_app/.env.example,sha256=XMTXjcdM6hWwQiK9gSkWM9NxkryCCgWAVXvEEZRXCZk,413
2
- faster_app/__init__.py,sha256=FyUe9NYdfIrBCAIurJ_V2KjCLZJemJXECPMIxIVwGY0,1426
2
+ faster_app/__init__.py,sha256=ahCrck49PB_Fm5M-FtByiyF2Tn-Xx4gmXAofS3JHHRI,1426
3
3
  faster_app/base.py,sha256=8350gBg_GkW_ww_lDvIOODFOJ71_yowQ5gd_tMTPrQ8,4035
4
4
  faster_app/db.py,sha256=uG4k_eSy5C2MP7DF-senxI10sLAGrLkgmBRFfH_91kY,994
5
5
  faster_app/main.py,sha256=WVFz5k1bjfnij87JDvT-rXQyd_ufDh25msikSA6TbLs,276
@@ -7,7 +7,7 @@ faster_app/commands/__init__.py,sha256=AgjI6NmKpdzNTH93XvXsvh54F7PiRX-MJq6emITw7
7
7
  faster_app/commands/base.py,sha256=mt0sictBXZdnkwQC9x4_MrOS-Z8msFyC72_mFzQ2Zfs,2545
8
8
  faster_app/commands/discover.py,sha256=o6X83vjq3A0rvKnQ6Y1G68tYd9qcVhoYMlYen9zOiK4,1076
9
9
  faster_app/commands/builtins/__init__.py,sha256=Wi3YfjUhZ45VNh7SoLdtCATjAPbWjSwv0gpmFZGJMHA,27
10
- faster_app/commands/builtins/app.py,sha256=FZpiaz9EpsdAVFAhUaHMR6medhyjW3X28HtkJ0XyAZE,939
10
+ faster_app/commands/builtins/app.py,sha256=SM8WuxG7EeDQ7gOxj2I8q5cQZN4YZkA_p7sRNrfuEzk,1677
11
11
  faster_app/commands/builtins/db.py,sha256=jrHOngEQw4Xuwf1uW4rZALfQX3M7SzsVTgzYrIVJaes,4735
12
12
  faster_app/commands/builtins/fastapi.py,sha256=o1rj11dUy5b_yoCGDfGX_zor-JPABKbotnvJpT-De3g,2428
13
13
  faster_app/models/__init__.py,sha256=6Mn6zjxF0JJfhDik4LNaXDNLxGgdgl5ECBbqLvgkpxs,334
@@ -28,9 +28,9 @@ faster_app/templates/apps/demo/commands.py,sha256=KECFqPzxn46qpveRARoxyyYk_ZVZ-R
28
28
  faster_app/templates/apps/demo/models.py,sha256=RfodpzyDfhwbfxfRg_qMwTVFjV7n8uLfJTFsCaWUNHs,328
29
29
  faster_app/templates/apps/demo/routes.py,sha256=Ye1IsU-xDox33IETZQ4K2LLIWkeby9whzVmQqB9JaFY,270
30
30
  faster_app/templates/config/settings.py,sha256=2Q58pumllN5a09mem3bPy-z65Jy5NTTicN4KjGJ-sY8,182
31
- faster_app-0.0.12.dist-info/licenses/LICENSE,sha256=VlZLv92YNpRecXnQ92BsEhMZK0zX453xnBFta4eGPRE,1073
32
- faster_app-0.0.12.dist-info/METADATA,sha256=Ye1XpFVFEchIqBanMOG0mob5ZKO8fk2cmdzKD5s1wg4,7383
33
- faster_app-0.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
- faster_app-0.0.12.dist-info/entry_points.txt,sha256=7PnCc_r0NYS1RU2OKbdod2sJBdUt8-JpmCCQSt0OLPs,52
35
- faster_app-0.0.12.dist-info/top_level.txt,sha256=Ah5KB3gcZwXCVsxO8kQtaC0Y7Uy__QFm1p_RJGo5UIU,11
36
- faster_app-0.0.12.dist-info/RECORD,,
31
+ faster_app-0.0.13.dist-info/licenses/LICENSE,sha256=VlZLv92YNpRecXnQ92BsEhMZK0zX453xnBFta4eGPRE,1073
32
+ faster_app-0.0.13.dist-info/METADATA,sha256=khwoaBJ3JvWMY-aOEaRbDn7uqRYOUSlJaJk3ar72zqM,7383
33
+ faster_app-0.0.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
34
+ faster_app-0.0.13.dist-info/entry_points.txt,sha256=7PnCc_r0NYS1RU2OKbdod2sJBdUt8-JpmCCQSt0OLPs,52
35
+ faster_app-0.0.13.dist-info/top_level.txt,sha256=Ah5KB3gcZwXCVsxO8kQtaC0Y7Uy__QFm1p_RJGo5UIU,11
36
+ faster_app-0.0.13.dist-info/RECORD,,