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
9b00dc84
Commit
9b00dc84
authored
Jun 18, 2001
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Products now initialize according to Product.__path__ ordering in case of name conflict.
parent
0c8a0e92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+11
-6
No files found.
lib/python/OFS/Application.py
View file @
9b00dc84
...
@@ -84,8 +84,8 @@
...
@@ -84,8 +84,8 @@
##############################################################################
##############################################################################
__doc__
=
'''Application support
__doc__
=
'''Application support
$Id: Application.py,v 1.15
1 2001/06/18 20:52:33
chrism Exp $'''
$Id: Application.py,v 1.15
2 2001/06/18 21:02:38
chrism Exp $'''
__version__
=
'$Revision: 1.15
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.15
2
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
time
,
traceback
,
os
,
string
,
Products
import
time
,
traceback
,
os
,
string
,
Products
...
@@ -502,14 +502,19 @@ def initialize(app):
...
@@ -502,14 +502,19 @@ def initialize(app):
def
get_products
():
def
get_products
():
""" Return a list of tuples in the form:
""" Return a list of tuples in the form:
[(priority, dir_name, base_dir), ...] for each Product directory
[(priority, dir_name,
index,
base_dir), ...] for each Product directory
found, sort before returning """
found, sort before returning """
products
=
[]
products
=
[]
i
=
0
for
product_dir
in
Products
.
__path__
:
for
product_dir
in
Products
.
__path__
:
product_names
=
os
.
listdir
(
product_dir
)
product_names
=
os
.
listdir
(
product_dir
)
for
name
in
product_names
:
for
name
in
product_names
:
priority
=
(
name
!=
'PluginIndexes'
)
# import PluginIndexes 1st
priority
=
(
name
!=
'PluginIndexes'
)
# import PluginIndexes 1st
products
.
append
((
priority
,
name
,
product_dir
))
# i is used as sort ordering in case a conflict exists
# between Product names. Products will be found as
# per the ordering of Products.__path__
products
.
append
((
priority
,
name
,
i
,
product_dir
))
i
=
i
+
1
products
.
sort
()
products
.
sort
()
return
products
return
products
...
@@ -519,7 +524,7 @@ def import_products():
...
@@ -519,7 +524,7 @@ def import_products():
products
=
get_products
()
products
=
get_products
()
for
priority
,
product_name
,
product_dir
in
products
:
for
priority
,
product_name
,
index
,
product_dir
in
products
:
if
done
.
has_key
(
product_name
):
continue
if
done
.
has_key
(
product_name
):
continue
done
[
product_name
]
=
1
done
[
product_name
]
=
1
import_product
(
product_dir
,
product_name
)
import_product
(
product_dir
,
product_name
)
...
@@ -579,7 +584,7 @@ def install_products(app):
...
@@ -579,7 +584,7 @@ def install_products(app):
products
=
get_products
()
products
=
get_products
()
for
priority
,
product_name
,
product_dir
in
products
:
for
priority
,
product_name
,
index
,
product_dir
in
products
:
# For each product, we will import it and try to call the
# For each product, we will import it and try to call the
# intialize() method in the product __init__ module. If
# intialize() method in the product __init__ module. If
# the method doesnt exist, we put the old-style information
# the method doesnt exist, we put the old-style information
...
...
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