kajiki icon indicating copy to clipboard operation
kajiki copied to clipboard

reload does not work, at least with derived filenames

Open alexbodn opened this issue 7 years ago • 5 comments

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

alexbodn avatar Nov 26 '16 17:11 alexbodn

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- avatar Nov 27 '16 08:11 amol-

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- avatar Nov 27 '16 09:11 amol-

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.

amol- avatar Nov 27 '16 19:11 amol-

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 avatar Nov 28 '16 10:11 alexbodn

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

alexbodn avatar Nov 28 '16 12:11 alexbodn