Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
30a481f
create barebones templatetags
Archmonger Jul 22, 2021
8b0b363
styling fix
Archmonger Jul 22, 2021
4bcd9bf
idom_view
Archmonger Jul 26, 2021
f8f094e
skeleton of django installable app
rmorshea Jul 26, 2021
937da20
get test_app runserver to work
rmorshea Jul 26, 2021
e76408b
fix MANIFEST.in to include static/templates
rmorshea Jul 28, 2021
f008f6b
fix style
rmorshea Jul 28, 2021
b4f256b
require a my_app.idom.components attribute
rmorshea Jul 28, 2021
a0b75e0
parametrized components + serve web modules
rmorshea Jul 28, 2021
cd12a7c
add IDOM_IGNORED_DJANGO_APPS option
rmorshea Jul 29, 2021
9f4412d
add basic docs to README
rmorshea Jul 29, 2021
34452e4
minor doc improvements
rmorshea Jul 29, 2021
3e07d5a
more doc updates
rmorshea Jul 29, 2021
0ff84ec
make logger private
rmorshea Aug 5, 2021
fbb0037
use string path to template
rmorshea Aug 5, 2021
407b506
rename URL resolver functions
rmorshea Aug 5, 2021
fa95bb1
fix flake8
rmorshea Aug 5, 2021
9da3de8
correct template tag description
rmorshea Aug 5, 2021
a05d0ef
update app organization in README
rmorshea Aug 5, 2021
937244c
switch to decorator collection method
rmorshea Aug 11, 2021
af6601d
load components using template names
rmorshea Aug 12, 2021
60384af
minor README tweaks
rmorshea Aug 12, 2021
f72b2d6
remove unused config option
rmorshea Aug 12, 2021
4bcdeb5
use different param name in README ex
rmorshea Aug 12, 2021
536968a
cache and asyncify web module loading
rmorshea Aug 19, 2021
aee70a7
rename idom_view to idom_component
rmorshea Aug 19, 2021
7093252
README rename your_template to your_view
rmorshea Aug 19, 2021
66b7cb3
fix README typo
rmorshea Aug 19, 2021
4a4fa74
make websocket and web module paths consts
rmorshea Aug 19, 2021
b209995
correct terminology
rmorshea Aug 19, 2021
b9934de
slim down README asgi.py description
rmorshea Aug 19, 2021
fa70766
better summarize what IDOM is
rmorshea Aug 19, 2021
a15c334
bump copyright year
rmorshea Aug 19, 2021
aed7fc7
fix template formatting
rmorshea Aug 19, 2021
68aa643
rename your_app to your_project
rmorshea Aug 19, 2021
83e3f7c
add CODEOWNERS
rmorshea Aug 19, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make logger private
  • Loading branch information
rmorshea committed Aug 5, 2021
commit 0ff84ecf916ced5a833361b7a585a24b9d72da2a
8 changes: 4 additions & 4 deletions src/django_idom/app_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .app_settings import IDOM_IGNORE_INSTALLED_APPS


logger = logging.getLogger(__name__)
_logger = logging.getLogger(__name__)
_LOADED_COMPONENTS: Dict[str, ComponentConstructor] = {}


Expand All @@ -22,19 +22,19 @@ def has_component(name: str) -> bool:

for app_mod_name in settings.INSTALLED_APPS:
if app_mod_name in IDOM_IGNORE_INSTALLED_APPS:
logger.debug(f"{app_mod_name!r} skipped by IDOM_IGNORE_INSTALLED_APPS")
_logger.debug(f"{app_mod_name!r} skipped by IDOM_IGNORE_INSTALLED_APPS")
continue

idom_mod_name = f"{app_mod_name}.idom"

try:
idom_mod = import_module(idom_mod_name)
except ImportError:
logger.debug(f"Skipping {idom_mod_name!r} - does not exist")
_logger.debug(f"Skipping {idom_mod_name!r} - does not exist")
continue

if not hasattr(idom_mod, "components"):
logger.warning(
_logger.warning(
f"'django_idom' expected module {idom_mod_name!r} to have an "
"'components' attribute that lists its publically available components."
)
Expand Down
6 changes: 3 additions & 3 deletions src/django_idom/websocket_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .app_components import get_component, has_component


logger = logging.getLogger(__name__)
_logger = logging.getLogger(__name__)


class IdomAsyncWebSocketConsumer(AsyncJsonWebsocketConsumer):
Expand All @@ -39,7 +39,7 @@ async def _run_dispatch_loop(self):
view_id = self.scope["url_route"]["kwargs"]["view_id"]

if not has_component(view_id):
logger.warning(f"Uknown IDOM view ID {view_id!r}")
_logger.warning(f"Uknown IDOM view ID {view_id!r}")
return

component_constructor = get_component(view_id)
Expand All @@ -50,7 +50,7 @@ async def _run_dispatch_loop(self):
try:
component_instance = component_constructor(**component_kwargs)
except Exception:
logger.exception(
_logger.exception(
f"Failed to construct component {component_constructor} "
f"with parameters {component_kwargs}"
)
Expand Down