[Zope3-checkins] SVN: Zope3/branches/3.3/src/zope/ Fix more cases
of zope.__file__. In case of zope.app.locales.extract we don't
Philipp von Weitershausen
philikon at philikon.de
Sun Aug 13 17:56:55 EDT 2006
Log message for revision 69460:
Fix more cases of zope.__file__. In case of zope.app.locales.extract we don't
have to do anything now. When this script eventulaly moves somewhere else
to be better reusable (zope.i18n perhaps), the code should be refactored (added
TODO comment).
THis addresses collector #683.
Changed:
U Zope3/branches/3.3/src/zope/app/apidoc/utilities.py
U Zope3/branches/3.3/src/zope/app/locales/extract.py
U Zope3/branches/3.3/src/zope/configuration/stxdocs.py
U Zope3/branches/3.3/src/zope/dependencytool/finddeps.py
-=-
Modified: Zope3/branches/3.3/src/zope/app/apidoc/utilities.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/apidoc/utilities.py 2006-08-13 21:33:17 UTC (rev 69459)
+++ Zope3/branches/3.3/src/zope/app/apidoc/utilities.py 2006-08-13 21:56:54 UTC (rev 69460)
@@ -23,7 +23,7 @@
import inspect
from os.path import dirname
-import zope
+import zope.app
from zope.interface import implements, implementedBy
from zope.publisher.browser import TestRequest
from zope.security.checker import getCheckerForInstancesOf, Global
@@ -43,7 +43,7 @@
_marker = object()
-BASEDIR = dirname(dirname(dirname(zope.__file__)))
+BASEDIR = dirname(dirname(dirname(dirname(zope.app.__file__))))
def relativizePath(path):
return path.replace(BASEDIR, 'Zope3')
Modified: Zope3/branches/3.3/src/zope/app/locales/extract.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/locales/extract.py 2006-08-13 21:33:17 UTC (rev 69459)
+++ Zope3/branches/3.3/src/zope/app/locales/extract.py 2006-08-13 21:56:54 UTC (rev 69460)
@@ -373,6 +373,7 @@
import zope
dirname = os.path.dirname
if site_zcml is None:
+ # TODO this assumes a checkout directory structure
site_zcml = os.path.join(dirname(dirname(dirname(zope.__file__))),
"site.zcml")
context = config(site_zcml, features=("devmode",), execute=False)
Modified: Zope3/branches/3.3/src/zope/configuration/stxdocs.py
===================================================================
--- Zope3/branches/3.3/src/zope/configuration/stxdocs.py 2006-08-13 21:33:17 UTC (rev 69459)
+++ Zope3/branches/3.3/src/zope/configuration/stxdocs.py 2006-08-13 21:56:54 UTC (rev 69460)
@@ -30,7 +30,7 @@
$Id$
"""
import sys, os, getopt
-import zope
+import zope.configuration
from zope.schema import getFieldsInOrder
from zope.configuration import config, xmlconfig
from zope.configuration.docutils import wrap, makeDocStructures
@@ -53,7 +53,8 @@
if isinstance(info, xmlconfig.ParserInfo):
# We do not want to specify the whole path; starting at the 'zope'
# package is enough.
- base_dir = os.path.dirname(zope.__file__)[:-4]
+ base_dir = os.path.dirname(os.path.dirname(
+ zope.configuration.__file__)[:-4]
file = info.file.replace(base_dir, '')
info_text = 'File %s, lines %i - %i.' %(file, info.line, info.eline)
Modified: Zope3/branches/3.3/src/zope/dependencytool/finddeps.py
===================================================================
--- Zope3/branches/3.3/src/zope/dependencytool/finddeps.py 2006-08-13 21:33:17 UTC (rev 69459)
+++ Zope3/branches/3.3/src/zope/dependencytool/finddeps.py 2006-08-13 21:56:54 UTC (rev 69460)
@@ -56,7 +56,8 @@
# Get the Zope base path
-ZOPESRC = os.path.dirname(os.path.dirname(zope.__file__))
+ZOPESRC = os.path.dirname(os.path.dirname(os.path.dirname(
+ zope.dependencytool.__file__)))
ZOPESRCPREFIX = os.path.join(ZOPESRC, "")
# Matching expression for python files.
More information about the Zope3-Checkins
mailing list