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

reload does not work, at least with derived filenames #28

Open
alexbodn opened this issue Nov 26, 2016 · 5 comments
Open

reload does not work, at least with derived filenames #28

alexbodn opened this issue Nov 26, 2016 · 5 comments

Comments

@alexbodn
Copy link

hello friends,
i'm using kajiki templates as mixed direct and dotted filenames.
the reload functionality had to be fixed, so i united it
under the smaller common denominator: the resolved filename.

please review my included patch:

alex
kajiki.diff.txt

@amol-
Copy link
Collaborator

amol- commented Nov 27, 2016

Were you using Kajiki directly or through TurboGears? (Asking because turbogears provides a custom FileLoader for kajiki)
Can you provide a short example that showcases how autoreload doesn't work?

@amol-
Copy link
Collaborator

amol- commented Nov 27, 2016

Asking because the quickstarted app of TG leverages mixing: dotted, standard filenames, dotted with forced extension and seems to properly work:

On first load:

CHECKING provak.templates.index
LOADING provak.templates.index
CHECKING master.xhtml
LOADING master.xhtml
CHECKING tgext.debugbar.templates.debugbar!html
LOADING tgext.debugbar.templates.debugbar!html

On next load:

CHECKING provak.templates.index
FROM CACHE provak.templates.index
CHECKING master.xhtml
FROM CACHE master.xhtml
CHECKING tgext.debugbar.templates.debugbar!html
FROM CACHE tgext.debugbar.templates.debugbar!html

After changing index:

CHECKING provak.templates.index
---> LOADING provak.templates.index
CHECKING master.xhtml
FROM CACHE master.xhtml
CHECKING tgext.debugbar.templates.debugbar!html
FROM CACHE tgext.debugbar.templates.debugbar!html

After changing master:

CHECKING provak.templates.index
FROM CACHE provak.templates.index
CHECKING master.xhtml
---> LOADING master.xhtml
CHECKING tgext.debugbar.templates.debugbar!html
FROM CACHE tgext.debugbar.templates.debugbar!html

@amol-
Copy link
Collaborator

amol- commented Nov 27, 2016

I think I understood what you meant.
You are mixing provak.templates.index and provak/templates/index.html inside the same app and the two end up being cached with two different cache keys.

@alexbodn
Copy link
Author

alexbodn commented Nov 28, 2016

thanks @amol for your consideration.
i'm happily using tg indeed, and that's the source of the dotted from, thanks.
but i'm not calling the same template both ways. even though is may happen somehow ;) .
just the '''name''' of the template could not be found in '''self.modules'''.
probably one case has been used before and the other after, the '''filename''' method.
anyway, reducing all the names dealing to the filename makes most sense to me, since, and as far as, it's all about real files.

@alexbodn
Copy link
Author

one more source of error could be my usage of the templates search path from turbogears.
then, the original filenames will be truncated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants