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
4e3ddbd5
Commit
4e3ddbd5
authored
Oct 02, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "DevelopmentMode" that auto-reloads HTMLFile objects.
parent
8a4e45c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
lib/python/Globals.py
lib/python/Globals.py
+11
-1
No files found.
lib/python/Globals.py
View file @
4e3ddbd5
"""Global definitions"""
__version__
=
'$Revision: 1.1
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
7
$'
[
11
:
-
2
]
import
sys
,
os
from
DateTime
import
DateTime
from
string
import
atof
,
rfind
import
Acquisition
DevelopmentMode
=
None
try
:
home
=
CUSTOMER_HOME
,
SOFTWARE_HOME
,
SOFTWARE_URL
...
...
@@ -104,6 +105,7 @@ class HTMLFile(DocumentTemplate.HTMLFile,MethodObject.Method,):
func_code
.
co_varnames
=
'trueself'
,
'self'
,
'REQUEST'
func_code
.
co_argcount
=
3
_need__name__
=
1
_v_last_read
=
0
def
__init__
(
self
,
name
,
_prefix
=
None
,
**
kw
):
if
_prefix
is
None
:
_prefix
=
SOFTWARE_HOME
+
'/lib/python'
...
...
@@ -113,6 +115,11 @@ class HTMLFile(DocumentTemplate.HTMLFile,MethodObject.Method,):
apply
(
HTMLFile
.
inheritedAttribute
(
'__init__'
),
args
,
kw
)
def
__call__
(
self
,
*
args
,
**
kw
):
if
DevelopmentMode
:
t
=
os
.
stat
(
self
.
raw
)
if
t
!=
self
.
_v_last_read
:
self
.
cook
()
self
.
_v_last_read
=
t
return
apply
(
HTMLFile
.
inheritedAttribute
(
'__call__'
),
(
self
,)
+
args
[
1
:],
kw
)
...
...
@@ -140,6 +147,9 @@ else:
# Log
#
# $Log: Globals.py,v $
# Revision 1.17 1998/10/02 15:00:22 jim
# Added "DevelopmentMode" that auto-reloads HTMLFile objects.
#
# Revision 1.16 1998/09/29 19:22:03 jim
# Added Acquisition
#
...
...
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