Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d16f0c50
Commit
d16f0c50
authored
Jan 27, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of import order dependencies in PageTemplates, TAL, and ZTUtils.
parent
1b8fb627
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
51 deletions
+17
-51
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+7
-36
lib/python/TAL/DummyEngine.py
lib/python/TAL/DummyEngine.py
+5
-6
lib/python/ZTUtils/__init__.py
lib/python/ZTUtils/__init__.py
+5
-9
No files found.
lib/python/Products/PageTemplates/Expressions.py
View file @
d16f0c50
...
...
@@ -44,42 +44,13 @@ def installHandlers(engine):
reg
(
'not'
,
NotExpr
)
reg
(
'defer'
,
DeferExpr
)
if
sys
.
modules
.
has_key
(
'Zope'
):
import
AccessControl
import
AccessControl.cAccessControl
acquisition_security_filter
=
AccessControl
.
cAccessControl
.
aq_validate
from
AccessControl
import
getSecurityManager
from
AccessControl.ZopeGuards
import
guarded_getattr
try
:
from
AccessControl
import
Unauthorized
except
ImportError
:
Unauthorized
=
"Unauthorized"
from
ZRPythonExpr
import
PythonExpr
,
_SecureModuleImporter
,
call_with_ns
else
:
from
PythonExpr
import
getSecurityManager
,
PythonExpr
guarded_getattr
=
getattr
try
:
from
zExceptions
import
Unauthorized
except
ImportError
:
Unauthorized
=
"Unauthorized"
def
acquisition_security_filter
(
orig
,
inst
,
name
,
v
,
real_validate
):
if
real_validate
(
orig
,
inst
,
name
,
v
):
return
1
raise
Unauthorized
,
name
def
call_with_ns
(
f
,
ns
,
arg
=
1
):
if
arg
==
2
:
return
f
(
None
,
ns
)
else
:
return
f
(
ns
)
class
_SecureModuleImporter
:
"""Simple version of the importer for use with trusted code."""
__allow_access_to_unprotected_subobjects__
=
1
def
__getitem__
(
self
,
module
):
__import__
(
module
)
return
sys
.
modules
[
module
]
import
AccessControl
import
AccessControl.cAccessControl
acquisition_security_filter
=
AccessControl
.
cAccessControl
.
aq_validate
from
AccessControl
import
getSecurityManager
from
AccessControl.ZopeGuards
import
guarded_getattr
from
AccessControl
import
Unauthorized
from
ZRPythonExpr
import
PythonExpr
,
_SecureModuleImporter
,
call_with_ns
SecureModuleImporter
=
_SecureModuleImporter
()
...
...
lib/python/TAL/DummyEngine.py
View file @
d16f0c50
...
...
@@ -23,12 +23,11 @@ from ITALES import ITALESCompiler, ITALESEngine
from
DocumentTemplate.DT_Util
import
ustr
IDomain
=
None
if
sys
.
modules
.
has_key
(
'Zope'
):
try
:
from
Zope.I18n.ITranslationService
import
ITranslationService
from
Zope.I18n.IDomain
import
IDomain
except
ImportError
:
pass
try
:
from
Zope.I18n.ITranslationService
import
ITranslationService
from
Zope.I18n.IDomain
import
IDomain
except
ImportError
:
pass
if
IDomain
is
None
:
# Before 2.7, or not in Zope
class
ITranslationService
:
pass
...
...
lib/python/ZTUtils/__init__.py
View file @
d16f0c50
...
...
@@ -15,16 +15,12 @@
$Id$
"""
from
Batch
import
Batch
from
Iterator
import
Iterator
from
Tree
import
TreeMaker
,
encodeExpansion
,
decodeExpansion
,
a2b
,
b2a
from
Tree
import
encodeExpansion
,
decodeExpansion
,
a2b
,
b2a
from
SimpleTree
import
SimpleTreeMaker
import
sys
if
sys
.
modules
.
has_key
(
'Zope'
):
del
sys
__allow_access_to_unprotected_subobjects__
=
1
__roles__
=
None
__allow_access_to_unprotected_subobjects__
=
1
__roles__
=
None
from
Zope
import
Batch
,
TreeMaker
,
SimpleTreeMaker
,
LazyFilter
from
Zope
import
url_query
,
make_query
,
make_hidden_input
from
ZTUtils.
Zope
import
Batch
,
TreeMaker
,
SimpleTreeMaker
,
LazyFilter
from
ZTUtils.
Zope
import
url_query
,
make_query
,
make_hidden_input
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment