cloudoll 2.2.26__tar.gz → 2.2.28__tar.gz
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.
- {cloudoll-2.2.26 → cloudoll-2.2.28}/PKG-INFO +6 -1
- {cloudoll-2.2.26 → cloudoll-2.2.28}/README.md +5 -0
- cloudoll-2.2.28/cloudoll/__init__.py +1 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/cli.py +2 -2
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/__init__.py +6 -2
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/snowflake.py +3 -3
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/watch.py +8 -7
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/__init__.py +1 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/PKG-INFO +6 -1
- cloudoll-2.2.26/cloudoll/__init__.py +0 -1
- {cloudoll-2.2.26 → cloudoll-2.2.28}/LICENSE +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/__main__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/error/__init__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/error/errors.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/logging/__init__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/mail/__init__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/mail/smtp.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/base.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/err.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/field.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/model.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/mysql.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/parse.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/orm/postgres.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/robot/__init__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/robot/dingtalk.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/robot/feishu.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/robot/slack.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/__init__.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/common.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/m2d.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/utils/patch_loop.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/exception.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/html.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/http.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/jwt.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll/web/settings.py +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/SOURCES.txt +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/dependency_links.txt +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/entry_points.txt +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/requires.txt +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/cloudoll.egg-info/top_level.txt +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/setup.cfg +0 -0
- {cloudoll-2.2.26 → cloudoll-2.2.28}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloudoll
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.28
|
|
4
4
|
Summary: 辅助快速创建可分布的微服务。
|
|
5
5
|
Home-page: https://gitee.com/chuchur/cloudoll-py
|
|
6
6
|
Author: chuchur
|
|
@@ -33,6 +33,11 @@ Requires-Dist: click
|
|
|
33
33
|
# cloudoll 云端玩具
|
|
34
34
|
|
|
35
35
|
## 更新日志
|
|
36
|
+
|
|
37
|
+
`2.2.28` 2023-07-04
|
|
38
|
+
- 多数据库支持
|
|
39
|
+
- 优化orm
|
|
40
|
+
-
|
|
36
41
|
`2.0.14` 2023-07-04
|
|
37
42
|
- 加入cli,devtoll
|
|
38
43
|
- 优化orm
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.2.28"
|
|
@@ -89,7 +89,7 @@ def start(environment, host, port, mode, path, entry) -> None:
|
|
|
89
89
|
# print(environment, host, port, mode, path, entry)
|
|
90
90
|
# return
|
|
91
91
|
if mode == 'production':
|
|
92
|
-
App = app.create(config=config, entry_model=entry)
|
|
92
|
+
App = app.create(env=environment, config=config, entry_model=entry)
|
|
93
93
|
App.run()
|
|
94
94
|
return
|
|
95
95
|
aux_app = web.Application(
|
|
@@ -102,7 +102,7 @@ def start(environment, host, port, mode, path, entry) -> None:
|
|
|
102
102
|
config["server"] = server
|
|
103
103
|
|
|
104
104
|
aux_port = int(server.port) + 1
|
|
105
|
-
task = AppTask(Path(".").resolve(), config, entry=entry)
|
|
105
|
+
task = AppTask(Path(".").resolve(), config, entry=entry, env=environment)
|
|
106
106
|
aux_app.cleanup_ctx.append(task.cleanup_ctx)
|
|
107
107
|
web.run_app(
|
|
108
108
|
aux_app,
|
|
@@ -116,13 +116,15 @@ class Postgres(MeteBase):
|
|
|
116
116
|
|
|
117
117
|
async def query(self, sql, params=None, query_type: QueryTypes = 2, size: int = 10):
|
|
118
118
|
sql = sql.replace("?", "%s").replace('`', '"')
|
|
119
|
-
print_info("sql", sql, params)
|
|
120
119
|
if not self.pool:
|
|
121
120
|
raise ValueError("must be create_engine first.")
|
|
122
121
|
if self.pool._closing or self.pool._closed:
|
|
123
122
|
return None
|
|
124
123
|
|
|
125
124
|
async with self.pool.acquire() as conn:
|
|
125
|
+
if conn.echo:
|
|
126
|
+
print_info("sql", sql, params)
|
|
127
|
+
|
|
126
128
|
async with conn.cursor() as cursor:
|
|
127
129
|
# current_cursor = getattr(cursor, 'lastrowid', None)
|
|
128
130
|
if (
|
|
@@ -226,12 +228,14 @@ class Mysql(MeteBase):
|
|
|
226
228
|
|
|
227
229
|
async def query(self, sql, params=None, query_type: QueryTypes = 2, size: int = 10):
|
|
228
230
|
sql = sql.replace("?", "%s")
|
|
229
|
-
# print_info("sql", sql, params)
|
|
230
231
|
if not self.pool:
|
|
231
232
|
raise ValueError("must be create_engine first.")
|
|
232
233
|
if self.pool._closing or self.pool._closed:
|
|
233
234
|
return None
|
|
234
235
|
async with self.pool.acquire() as conn:
|
|
236
|
+
if conn.echo:
|
|
237
|
+
print_info("sql", sql, params)
|
|
238
|
+
|
|
235
239
|
async with conn.cursor() as cursor:
|
|
236
240
|
# current_cursor = getattr(cursor, 'lastrowid', None)
|
|
237
241
|
if (
|
|
@@ -72,11 +72,11 @@ def set_tty(tty_path: Optional[str]) -> Iterator[None]:
|
|
|
72
72
|
yield
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
def mian_app(tty_path, config, entry):
|
|
75
|
+
def mian_app(tty_path, config, entry, env):
|
|
76
76
|
with set_tty(tty_path):
|
|
77
77
|
if sys.version_info >= (3, 11):
|
|
78
78
|
with asyncio.Runner() as runner:
|
|
79
|
-
app_runner = runner.run(create_main_app(config, entry))
|
|
79
|
+
app_runner = runner.run(create_main_app(config, entry, env))
|
|
80
80
|
try:
|
|
81
81
|
runner.run(start_main_app(app_runner, config["server"]["port"]))
|
|
82
82
|
runner.get_loop().run_forever()
|
|
@@ -87,7 +87,7 @@ def mian_app(tty_path, config, entry):
|
|
|
87
87
|
runner.run(app_runner.cleanup())
|
|
88
88
|
else:
|
|
89
89
|
loop = asyncio.new_event_loop()
|
|
90
|
-
runner = loop.run_until_complete(create_main_app(config, entry))
|
|
90
|
+
runner = loop.run_until_complete(create_main_app(config, entry, env))
|
|
91
91
|
try:
|
|
92
92
|
loop.run_until_complete(
|
|
93
93
|
start_main_app(runner, config["server"]["port"])
|
|
@@ -100,9 +100,9 @@ def mian_app(tty_path, config, entry):
|
|
|
100
100
|
loop.run_until_complete(runner.cleanup())
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
async def create_main_app(config, entry):
|
|
103
|
+
async def create_main_app(config, entry, env):
|
|
104
104
|
await check_port_open(config["server"]["port"])
|
|
105
|
-
App = app.create(config=config, entry_model=entry)
|
|
105
|
+
App = app.create(env=env, config=config, entry_model=entry)
|
|
106
106
|
return web.AppRunner(App.app, shutdown_timeout=0.1)
|
|
107
107
|
|
|
108
108
|
|
|
@@ -113,9 +113,10 @@ async def start_main_app(runner, port):
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
class AppTask(WatchTask):
|
|
116
|
-
def __init__(self, watch_path: str, config, entry: None):
|
|
116
|
+
def __init__(self, watch_path: str, config, entry: None, env: str):
|
|
117
117
|
self._config = config
|
|
118
118
|
self._entry = entry
|
|
119
|
+
self._env = env
|
|
119
120
|
self._reloads = 0
|
|
120
121
|
assert watch_path
|
|
121
122
|
super().__init__(watch_path)
|
|
@@ -153,7 +154,7 @@ class AppTask(WatchTask):
|
|
|
153
154
|
tty_path = None
|
|
154
155
|
|
|
155
156
|
self._process = Process(
|
|
156
|
-
target=mian_app, args=(tty_path, self._config, self._entry)
|
|
157
|
+
target=mian_app, args=(tty_path, self._config, self._entry, self._env)
|
|
157
158
|
)
|
|
158
159
|
self._process.start()
|
|
159
160
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloudoll
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.28
|
|
4
4
|
Summary: 辅助快速创建可分布的微服务。
|
|
5
5
|
Home-page: https://gitee.com/chuchur/cloudoll-py
|
|
6
6
|
Author: chuchur
|
|
@@ -33,6 +33,11 @@ Requires-Dist: click
|
|
|
33
33
|
# cloudoll 云端玩具
|
|
34
34
|
|
|
35
35
|
## 更新日志
|
|
36
|
+
|
|
37
|
+
`2.2.28` 2023-07-04
|
|
38
|
+
- 多数据库支持
|
|
39
|
+
- 优化orm
|
|
40
|
+
-
|
|
36
41
|
`2.0.14` 2023-07-04
|
|
37
42
|
- 加入cli,devtoll
|
|
38
43
|
- 优化orm
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.26"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|