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
5fcbc1b1
Commit
5fcbc1b1
authored
Apr 24, 2000
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor a little and add support for automatic registration of API documentation help topics.
parent
73d13906
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lib/python/App/ProductContext.py
lib/python/App/ProductContext.py
+13
-3
No files found.
lib/python/App/ProductContext.py
View file @
5fcbc1b1
...
...
@@ -86,7 +86,7 @@
"""
from
AccessControl.PermissionRole
import
PermissionRole
import
Globals
,
os
,
OFS
.
ObjectManager
,
OFS
.
misc_
,
Products
,
OFS
.
PropertySheets
from
HelpSys
import
HelpTopic
from
HelpSys
import
HelpTopic
,
APIHelpTopic
from
HelpSys.HelpSystem
import
ProductHelp
import
string
,
os
.
path
import
stat
...
...
@@ -264,11 +264,17 @@ class ProductContext:
return
self
.
registerZClass
(
Z
,
meta_type
)
def
getProductHelp
(
self
):
"""
Returns the ProductHelp associated with the current Product.
"""
return
self
.
__prod
.
__of__
(
self
.
__app
.
Control_Panel
.
Products
).
getProductHelp
()
def
registerHelpTopic
(
self
,
id
,
topic
):
"""
Register a Help Topic for a product.
"""
self
.
__prod
.
__of__
(
self
.
__app
.
Control_Panel
.
Products
).
getProductHelp
().
_setObject
(
id
,
topic
)
self
.
getProductHelp
().
_setObject
(
id
,
topic
)
def
registerHelp
(
self
,
directory
=
'help'
,
clear
=
1
):
"""
...
...
@@ -286,8 +292,9 @@ class ProductContext:
.html .htm .txt -- TextHelpTopic
.stx .txt -- STXHelpTopic
.jpg .png .gif -- ImageHelpTopic
.py -- APIHelpTopic
"""
help
=
self
.
__prod
.
__of__
(
self
.
__app
.
Control_Panel
.
Products
).
getProductHelp
()
help
=
self
.
getProductHelp
()
path
=
os
.
path
.
join
(
Globals
.
package_home
(
self
.
__pack
.
__dict__
),
directory
)
# test to see if nothing has changed since last registration
...
...
@@ -315,3 +322,6 @@ class ProductContext:
elif
ext
in
(
'.jpg'
,
'.gif'
,
'.png'
):
ht
=
HelpTopic
.
ImageTopic
(
file
,
''
,
os
.
path
.
join
(
path
,
file
))
self
.
registerHelpTopic
(
file
,
ht
)
elif
ext
in
(
'.py'
,):
ht
=
APIHelpTopic
.
APIHelpTopic
(
file
,
''
,
os
.
path
.
join
(
path
,
file
))
self
.
registerHelpTopic
(
file
,
ht
)
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