wwwpy
Advanced tools
| from __future__ import annotations | ||
| def id_to_hex(obj) -> str: | ||
| """Convert an object's ID to a shorter hexadecimal representation.""" | ||
| return hex(id(obj)).upper()[2:] |
+1
-1
| Metadata-Version: 2.4 | ||
| Name: wwwpy | ||
| Version: 0.1.80 | ||
| Version: 0.1.81 | ||
| Summary: Build Powerful Web Applications: Simple, Scalable, and Fully Customizable | ||
@@ -5,0 +5,0 @@ Author-email: Simone Giacomelli <simone.giacomelli@gmail.com> |
+1
-1
| # https://packaging.python.org/en/latest/tutorials/packaging-projects/ | ||
| [project] | ||
| name = "wwwpy" | ||
| version = "0.1.80" | ||
| version = "0.1.81" | ||
@@ -6,0 +6,0 @@ # todo |
| Metadata-Version: 2.4 | ||
| Name: wwwpy | ||
| Version: 0.1.80 | ||
| Version: 0.1.81 | ||
| Summary: Build Powerful Web Applications: Simple, Scalable, and Fully Customizable | ||
@@ -5,0 +5,0 @@ Author-email: Simone Giacomelli <simone.giacomelli@gmail.com> |
@@ -46,2 +46,3 @@ LICENSE | ||
| src/wwwpy/common/state.py | ||
| src/wwwpy/common/strings.py | ||
| src/wwwpy/common/tree.py | ||
@@ -48,0 +49,0 @@ src/wwwpy/common/databind/__init__.py |
@@ -1,3 +0,3 @@ | ||
| __version__ = "0.1.80" | ||
| git_hash_short = "3a0138a" | ||
| git_hash = "3a0138a70b1580033b5c2d276d0d01e7e3f50e0f" | ||
| __version__ = "0.1.81" | ||
| git_hash_short = "76bfe48" | ||
| git_hash = "76bfe48af6490bdfa59badd84f990eb6a29d9184" |
@@ -27,4 +27,6 @@ import logging | ||
| return | ||
| formatter = logging.Formatter('%(asctime)s %(levelname).1s %(name)s:%(lineno)d - %(message)s') | ||
| from wwwpy.common.detect import is_pyodide | ||
| # side = 'R' if is_pyodide() else 'S' | ||
| side = '🌎' if is_pyodide() else '🏛' | ||
| formatter = logging.Formatter(f'%(asctime)s {side} %(levelname).1s %(name)s:%(lineno)d - %(message)s') | ||
| custom_handler = _CustomHandler(emit) | ||
@@ -31,0 +33,0 @@ custom_handler.setFormatter(formatter) |
| from __future__ import annotations | ||
| import inspect | ||
| import logging | ||
@@ -9,2 +8,3 @@ import sys | ||
| def reload(module): | ||
@@ -19,4 +19,11 @@ import importlib | ||
| try: | ||
| module_path = inspect.getfile(module) | ||
| return module_path.startswith(path) and module_path != __file__ | ||
| module_file = getattr(module, '__file__', None) | ||
| if module_file: | ||
| return module_file.startswith(path) and module_file != __file__ | ||
| module_path = getattr(module, '__path__', None) | ||
| if module_path: | ||
| acc = any(p.startswith(path) for p in module_path) | ||
| if acc and not all(p.startswith(path) for p in module_path): | ||
| logger.warning(f'hot-reload: module `{module}` has mixed paths: {module_path}') | ||
| return acc | ||
| except: | ||
@@ -23,0 +30,0 @@ return False |
@@ -13,2 +13,3 @@ import base64 | ||
| from wwwpy.common import result | ||
| from wwwpy.common.strings import id_to_hex | ||
@@ -47,3 +48,3 @@ T = TypeVar('T') | ||
| elif not isinstance(obj, cls): | ||
| raise ValueError(f"Expected object of type {cls}, got {type(obj)}") | ||
| raise ValueError(f"Expected object of type {cls}, got {type(obj)} , {id_to_hex(cls)} != {id_to_hex(type(obj))}") | ||
| if is_dataclass(obj): | ||
@@ -50,0 +51,0 @@ field_types = typing.get_type_hints(cls) |
@@ -37,3 +37,7 @@ from __future__ import annotations | ||
| # The context parameter contains details about the exception | ||
| logger.info(f"Global handler caught: {context['message']}") | ||
| if 'message' in context: | ||
| logger.info(f"Global handler caught: {context['message']}") | ||
| if 'exception' not in context: | ||
| logger.error(f"Global handler caught: {context}") | ||
| return | ||
| exception = context.get('exception') | ||
@@ -40,0 +44,0 @@ if exception: |
@@ -1,4 +0,5 @@ | ||
| from js import window | ||
| import asyncio | ||
| import pytest | ||
| from js import window | ||
@@ -28,5 +29,5 @@ | ||
| print(f'method={method}') | ||
| print(f'data=`{data}`') | ||
| print(f'data=`{data[:100]}`') | ||
| response = await window.fetch(url, method=method, body=data) | ||
| text = await response.text() | ||
| return text |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
750973
0.13%197
0.51%11167
0.16%