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
7789a4ea
Commit
7789a4ea
authored
Mar 05, 2007
by
Rocky Burt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer opens a zodb connection every time a ProductDispatcher is looked up.
parent
e983a2a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/App/FactoryDispatcher.py
lib/python/App/FactoryDispatcher.py
+5
-22
No files found.
doc/CHANGES.txt
View file @
7789a4ea
...
@@ -8,6 +8,9 @@ Zope Changes
...
@@ -8,6 +8,9 @@ Zope Changes
Bugs fixed
Bugs fixed
- No longer opens a zodb connection every time a ProductDispatcher
is looked up.
- Collector #2288: @ and + should not be quoted when forming
- Collector #2288: @ and + should not be quoted when forming
request URLs in BaseRequest and HTTPRequest
request URLs in BaseRequest and HTTPRequest
...
...
lib/python/App/FactoryDispatcher.py
View file @
7789a4ea
...
@@ -26,31 +26,14 @@ def _product_packages():
...
@@ -26,31 +26,14 @@ def _product_packages():
zope2 packages and those without the Products namespace package.
zope2 packages and those without the Products namespace package.
"""
"""
old_product_
packages
=
{}
packages
=
{}
for
x
in
dir
(
Products
):
for
x
in
dir
(
Products
):
m
=
getattr
(
Products
,
x
)
m
=
getattr
(
Products
,
x
)
if
isinstance
(
m
,
types
.
ModuleType
):
if
isinstance
(
m
,
types
.
ModuleType
):
old_product_packages
[
x
]
=
m
packages
[
x
]
=
m
packages
=
{}
for
m
in
getattr
(
Products
,
'_registered_packages'
,
[]):
app
=
Zope2
.
app
()
packages
[
m
.
__name__
]
=
m
try
:
products
=
app
.
Control_Panel
.
Products
for
product_id
in
products
.
objectIds
():
product
=
products
[
product_id
]
if
hasattr
(
product
,
'package_name'
):
pos
=
product
.
package_name
.
rfind
(
'.'
)
if
pos
>
-
1
:
packages
[
product_id
]
=
__import__
(
product
.
package_name
,
globals
(),
{},
product
.
package_name
[
pos
+
1
:])
else
:
packages
[
product_id
]
=
__import__
(
product
.
package_name
)
elif
old_product_packages
.
has_key
(
product_id
):
packages
[
product_id
]
=
old_product_packages
[
product_id
]
finally
:
app
.
_p_jar
.
close
()
return
packages
return
packages
...
...
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