From b26dbd64e698ab3691becd621293bc336aca9b93 Mon Sep 17 00:00:00 2001 From: Lennart Regebro Date: Mon, 15 Feb 2016 22:09:57 +0100 Subject: [PATCH] Removing zope.app.appsetup as a dependency zope.app.appsetup drags in most of the rest of Zope 3, which is not needed to only extract i18n strings from ZCML, so I copied in the relevant code (and simplified it). --- setup.py | 1 - src/zope/app/locales/extract.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 2bb2753..f58b3ff 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,6 @@ def read(*rnames): ], extract=[ 'zope.tal', - 'zope.app.appsetup', ], ), include_package_data = True, diff --git a/src/zope/app/locales/extract.py b/src/zope/app/locales/extract.py index 4e92ce5..7248b1d 100644 --- a/src/zope/app/locales/extract.py +++ b/src/zope/app/locales/extract.py @@ -483,9 +483,14 @@ def py_strings(dir, domain="zope", exclude=(), verify_domain=False): def zcml_strings(dir, domain="zope", site_zcml=None): """Retrieve all ZCML messages from `dir` that are in the `domain`. """ - from zope.app.appsetup import config - dirname = os.path.dirname - context = config(site_zcml, features=("devmode",), execute=False) + from zope.configuration import xmlconfig, config + + # Load server-independent site config + context = config.ConfigurationMachine() + xmlconfig.registerCommonDirectives(context) + context.provideFeature("devmode") + context = xmlconfig.file(site_zcml, context=context, execute=False) + return context.i18n_strings.get(domain, {}) def tal_strings(dir,