diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-05 16:14:04 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-05 16:14:04 +0000 |
commit | e65ee315554600740a3ecc9dde351e7ded136023 (patch) | |
tree | 3073404df9dc37dec78df9d7ddc289568089bf77 /www-apps/nikola/files/nikola-8.2.4-yapsy.patch | |
parent | 68883bef20f77c2d72dfdf20bf5f9d4a5ea5ad9c (diff) |
gentoo auto-resync : 05:11:2023 - 16:14:03
Diffstat (limited to 'www-apps/nikola/files/nikola-8.2.4-yapsy.patch')
-rw-r--r-- | www-apps/nikola/files/nikola-8.2.4-yapsy.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/www-apps/nikola/files/nikola-8.2.4-yapsy.patch b/www-apps/nikola/files/nikola-8.2.4-yapsy.patch new file mode 100644 index 000000000000..563b92609879 --- /dev/null +++ b/www-apps/nikola/files/nikola-8.2.4-yapsy.patch @@ -0,0 +1,45 @@ +https://bugs.gentoo.org/916872 +https://github.com/getnikola/nikola/issues/3700 +Patch from upstream. + +commit 4f51e2e0a0b1c0de375d15d06cfacd703ab03040 +Author: Adam Williamson <awilliam@redhat.com> +Date: Sat, 15 Jul 2023 09:34:30 -0700 + + Handle change to plugin loading in recent yapsy (#3700) (#3701) + +--- a/nikola/plugin_categories.py ++++ b/nikola/plugin_categories.py +@@ -75,8 +75,31 @@ def set_site(self, site): + def inject_templates(self): + """Inject 'templates/<engine>' (if exists) very early in the theme chain.""" + try: ++ mod_candidate = None ++ # since https://github.com/tibonihoo/yapsy/pull/11 , ++ # yapsy only adds each imported plugin to sys.modules ++ # under its modified, "unique" name (see early in ++ # PluginManager.loadPlugins), so we recreate the ++ # modified name here to find it. we fudge the serial ++ # number here, assuming that if a plugin is loaded ++ # under the same name multiple times, the location ++ # will also be the same, so we can just use 0. ++ possible_names = ( ++ self.__class__.__module__, ++ "yapsy_loaded_plugin_" + self.__class__.__module__ + "_0", ++ "yapsy_loaded_plugin_" + self.name + "_0", ++ ) ++ for possible_name in possible_names: ++ mod_candidate = sys.modules.get(possible_name) ++ if mod_candidate: ++ break ++ if not mod_candidate: ++ # well, we tried. we wind up here for the dummy ++ # plugins; honestly I'm not sure exactly why/how, ++ # but they don't have templates, so it's okay ++ return + # Sorry, found no other way to get this +- mod_path = sys.modules[self.__class__.__module__].__file__ ++ mod_path = mod_candidate.__file__ + mod_dir = os.path.dirname(mod_path) + tmpl_dir = os.path.join( + mod_dir, 'templates', self.site.template_system.name |