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
ed0d596b
Commit
ed0d596b
authored
Apr 12, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove module-scope import aliases, use of exec.
parent
ec145751
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
31 deletions
+73
-31
src/Products/PluginIndexes/__init__.py
src/Products/PluginIndexes/__init__.py
+73
-31
No files found.
src/Products/PluginIndexes/__init__.py
View file @
ed0d596b
...
@@ -11,41 +11,83 @@
...
@@ -11,41 +11,83 @@
#
#
##############################################################################
##############################################################################
import
PathIndex.PathIndex
import
FieldIndex.FieldIndex
import
KeywordIndex.KeywordIndex
import
TopicIndex.TopicIndex
import
DateIndex.DateIndex
import
DateRangeIndex.DateRangeIndex
from
Products.PluginIndexes.common
import
ResultList
from
Products.PluginIndexes.common
import
UnIndex
_indexes
=
(
'KeywordIndex'
,
'FieldIndex'
,
'PathIndex'
,
'TopicIndex'
,
'DateIndex'
,
'DateRangeIndex'
,
)
def
initialize
(
context
):
def
initialize
(
context
):
for
idx
in
_indexes
:
from
Products.PluginIndexes.FieldIndex.FieldIndex
import
FieldIndex
from
Products.PluginIndexes.FieldIndex.FieldIndex
\
import
manage_addFieldIndex
from
Products.PluginIndexes.FieldIndex.FieldIndex
\
import
manage_addFieldIndexForm
context
.
registerClass
(
FieldIndex
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addFieldIndexForm
,
manage_addFieldIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
s
=
"context.registerClass(
\
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
import
KeywordIndex
%s.%s.%s,
\
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
\
permission='Add Pluggable Index',
\
import
manage_addKeywordIndex
constructors=(manage_add%sForm,
\
from
Products.PluginIndexes.KeywordIndex.KeywordIndex
\
manage_add%s),
\
import
manage_addKeywordIndexForm
icon='www/index.gif',
\
context
.
registerClass
(
KeywordIndex
,
visibility=None
\
permission
=
'Add Pluggable Index'
,
)"
%
(
idx
,
idx
,
idx
,
idx
,
idx
)
constructors
=
(
manage_addKeywordIndexForm
,
manage_addKeywordIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
exec
(
s
)
from
Products.PluginIndexes.TopicIndex.TopicIndex
import
TopicIndex
from
Products.PluginIndexes.TopicIndex.TopicIndex
\
import
manage_addTopicIndex
from
Products.PluginIndexes.TopicIndex.TopicIndex
\
import
manage_addTopicIndexForm
context
.
registerClass
(
TopicIndex
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addTopicIndexForm
,
manage_addTopicIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
from
Products.PluginIndexes.DateIndex.DateIndex
import
DateIndex
from
Products.PluginIndexes.DateIndex.DateIndex
\
import
manage_addDateIndex
from
Products.PluginIndexes.DateIndex.DateIndex
\
import
manage_addDateIndexForm
context
.
registerClass
(
DateIndex
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addDateIndexForm
,
manage_addDateIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
for
idx
in
_indexes
:
from
Products.PluginIndexes.DateRangeIndex.DateRangeIndex
\
import
DateRangeIndex
from
Products.PluginIndexes.DateRangeIndex.DateRangeIndex
\
import
manage_addDateRangeIndex
from
Products.PluginIndexes.DateRangeIndex.DateRangeIndex
\
import
manage_addDateRangeIndexForm
context
.
registerClass
(
DateRangeIndex
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addDateRangeIndexForm
,
manage_addDateRangeIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
exec
(
"manage_add%sForm = %s.%s.manage_add%sForm"
%
(
idx
,
idx
,
idx
,
idx
))
from
Products.PluginIndexes.PathIndex.PathIndex
import
PathIndex
exec
(
"manage_add%s = %s.%s.manage_add%s"
%
(
idx
,
idx
,
idx
,
idx
))
from
Products.PluginIndexes.PathIndex.PathIndex
\
import
manage_addPathIndex
from
Products.PluginIndexes.PathIndex.PathIndex
\
import
manage_addPathIndexForm
context
.
registerClass
(
PathIndex
,
permission
=
'Add Pluggable Index'
,
constructors
=
(
manage_addPathIndexForm
,
manage_addPathIndex
),
icon
=
'www/index.gif'
,
visibility
=
None
,
)
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