Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes minor Framer Motion errors #75

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nextpy.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Test message
Test message
Info message
Warning message
Error message
26 changes: 15 additions & 11 deletions nextpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,9 @@

# _MAPPING: Maps module paths as keys to lists of their attributes (classes, functions, variables) as values for dynamic imports.
_MAPPING = {
"nextpy.backend.admin": ["admin", "AdminDash"],
"nextpy.app": ["app", "App", "UploadFile"],
"nextpy.base": ["base", "Base"],
"nextpy.build.compiler": ["compiler"],
"nextpy.build.compiler.utils": ["get_asset_path"],
"nextpy.build.config": ["config", "Config", "DBConfig"],
"nextpy.backend.admin": ["admin", "AdminDash"],
"nextpy.backend.event": [
"event",
"EventChain",
Expand All @@ -272,21 +269,28 @@
"window_alert",
],
"nextpy.backend.middleware": ["middleware", "Middleware"],
"nextpy.backend.vars": ["vars", "cached_var", "Var"],
"nextpy.backend.route": ["route"],
"nextpy.backend.state": ["state", "var", "Cookie", "LocalStorage", "State"],
"nextpy.backend.utils": ["utils"],
"nextpy.backend.vars": ["vars", "cached_var", "Var"],
"nextpy.build.compiler": ["compiler"],
"nextpy.build.compiler.utils": ["get_asset_path"],
"nextpy.build.config": ["config", "Config", "DBConfig"],
"nextpy.build.testing": ["testing"],
"nextpy.data.model": ["model", "session", "Model"],
"nextpy.data.jsondb": ["JsonDatabase"],
"nextpy.frontend.components": _ALL_COMPONENTS,
"nextpy.frontend.components.component": ["memo"],
"nextpy.frontend.components.graphing": ["recharts"],
"nextpy.frontend.components.animation.motion": ["motion"],
"nextpy.frontend.components.datadisplay.moment": ["MomentDelta"],
"nextpy.constants": ["constants", "Env"],
"nextpy.frontend.page": ["page"],
"nextpy.frontend.components": _ALL_COMPONENTS,
"nextpy.frontend.components.component": ["memo"],
"nextpy.frontend.components.graphing": ["recharts"],
"nextpy.frontend.components.datadisplay.moment": ["MomentDelta"],
"nextpy.frontend.dom": ["dom"],
"nextpy.frontend.style": ["style", "color_mode", "toggle_color_mode"],
"nextpy.data.model": ["model", "session", "Model"],
"nextpy.data.jsondb": ["JsonDatabase"],
"nextpy.build.testing": ["testing"],
"nextpy.utils": ["utils"],
}
_MAPPING = {value: key for key, values in _MAPPING.items() for value in values}
anubrag marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -331,4 +335,4 @@ def __getattr__(name: str) -> Type:
getattr(module, name) if name != _MAPPING[name].rsplit(".")[-1] else module
)
except ModuleNotFoundError:
anubrag marked this conversation as resolved.
Show resolved Hide resolved
raise AttributeError(f"module 'nextpy' has no attribute {name}") from None
raise AttributeError(f"module 'nextpy' has no attribute {name}") from None
2 changes: 2 additions & 0 deletions nextpy/frontend/components/animation/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
"""The animation package."""

__all__ = [f for f in dir() if f[0].isupper()] # type: ignore
anubrag marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading