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
63acae73
Commit
63acae73
authored
May 02, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed auto-reloading of help topics
parent
e67aa99a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
24 deletions
+22
-24
lib/python/HelpSys/HelpTopic.py
lib/python/HelpSys/HelpTopic.py
+22
-24
No files found.
lib/python/HelpSys/HelpTopic.py
View file @
63acae73
...
...
@@ -194,6 +194,22 @@ class HelpTopic(Acquisition.Implicit, HelpTopicBase, Item, PropertyManager, Pers
(
'Access contents information'
,
(
'helpValues'
,)),
)
def
_set_last_read
(
self
,
filepath
):
try
:
mtime
=
os
.
stat
(
filepath
)[
8
]
except
:
mtime
=
0
self
.
_v_last_read
=
mtime
def
_check_for_update
(
self
):
if
Globals
.
DevelopmentMode
:
try
:
mtime
=
os
.
stat
(
self
.
file
)[
8
]
except
:
mtime
=
0
if
mtime
!=
self
.
_v_last_read
:
fileob
=
open
(
self
.
file
)
self
.
obj
=
fileob
.
read
()
fileob
.
close
()
self
.
_v_last_read
=
mtime
self
.
reindex_object
()
def
index_html
(
self
,
REQUEST
,
RESPONSE
):
"View the Help Topic"
raise
"Unimplemented"
...
...
@@ -250,6 +266,7 @@ class TextTopic(HelpTopic):
self
.
title
=
title
self
.
file
=
file
self
.
obj
=
open
(
file
).
read
()
self
.
_set_last_read
(
file
)
if
permissions
is
not
None
:
self
.
permissions
=
permissions
if
categories
is
not
None
:
...
...
@@ -257,14 +274,7 @@ class TextTopic(HelpTopic):
def
index_html
(
self
,
REQUEST
=
None
):
"View the Help Topic"
if
0
and
Globals
.
DevelopmentMode
:
try
:
mtime
=
os
.
stat
(
self
.
file
)
except
:
mtime
=
0
if
mtime
!=
self
.
_v_last_read
:
self
.
obj
=
open
(
self
.
file
).
read
()
self
.
_v_last_read
=
mtime
self
.
reindex_object
()
self
.
_check_for_update
()
return
self
.
obj
def
SearchableText
(
self
):
...
...
@@ -278,14 +288,7 @@ class STXTopic(TextTopic):
"""
def
index_html
(
self
,
REQUEST
=
None
):
""" View the STX Help Topic """
if
0
and
Globals
.
DevelopmentMode
:
try
:
mtime
=
os
.
stat
(
self
.
file
)
except
:
mtime
=
0
if
mtime
!=
self
.
_v_last_read
:
self
.
obj
=
open
(
self
.
file
).
read
()
self
.
_v_last_read
=
mtime
self
.
reindex_object
()
self
.
_check_for_update
()
return
self
.
htmlfile
(
self
,
REQUEST
)
htmlfile
=
HTML
(
"""
\
...
...
@@ -305,6 +308,8 @@ class ImageTopic(HelpTopic):
self
.
id
=
id
self
.
title
=
title
self
.
file
=
file
self
.
obj
=
open
(
file
).
read
()
self
.
_set_last_read
(
file
)
dir
,
file
=
os
.
path
.
split
(
file
)
self
.
image
=
ImageFile
(
file
,
dir
)
if
permissions
is
not
None
:
...
...
@@ -314,14 +319,7 @@ class ImageTopic(HelpTopic):
def
index_html
(
self
,
REQUEST
,
RESPONSE
):
"View the Help Topic"
if
0
and
Globals
.
DevelopmentMode
:
try
:
mtime
=
os
.
stat
(
self
.
file
)
except
:
mtime
=
0
if
mtime
!=
self
.
_v_last_read
:
self
.
obj
=
open
(
self
.
file
).
read
()
self
.
_v_last_read
=
mtime
self
.
reindex_object
()
self
.
_check_for_update
()
return
self
.
image
.
index_html
(
REQUEST
,
RESPONSE
)
def
SearchableText
(
self
):
...
...
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