-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy image and link helpers to dexlib
Pyramid requires access to the request object to be able to generate URLs, so the plan is to move helpers that generate URLs to dexlib, where they'll have access to the template context and thus the request object. This seems easier than adding an explicit 'request' or 'url' parameter to all of them. Copy image and url helpers from splinext.pokedex.helpers to dexlib. Update any internal references to those helpers, but leave external callers alone for now. The next few commits will start fixing up calls to the old functions. Keep the old functions around (for now) so as not to break anything. We can't do a move+update in one commit anyway because there is code in the `veekun` repository which still uses the old helpers. The _=_ parameters are no longer necessary because template functions already have access to the translator. Keep the parameters so that we don't break callers, but change the default to _=None because there is no longer a global _ variable in scope. (The default value doesn't matter - it gets immediately overwritten by a line that gets injected into template functions, `_ = i18n.get_translator(lambda i18n, c)`) Updates #115. Updates #117.
- Loading branch information
Showing
1 changed file
with
225 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters