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
6f6b079f
Commit
6f6b079f
authored
Aug 18, 1999
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a funky indent.
parent
afc624a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
58 deletions
+58
-58
lib/python/ZPublisher/Publish.py
lib/python/ZPublisher/Publish.py
+58
-58
No files found.
lib/python/ZPublisher/Publish.py
View file @
6f6b079f
...
...
@@ -84,8 +84,8 @@
##############################################################################
__doc__
=
"""Python Object Publisher -- Publish Python objects on web servers
$Id: Publish.py,v 1.13
8 1999/08/17 16:52:54 jim
Exp $"""
__version__
=
'$Revision: 1.13
8
$'
[
11
:
-
2
]
$Id: Publish.py,v 1.13
9 1999/08/18 00:24:46 amos
Exp $"""
__version__
=
'$Revision: 1.13
9
$'
[
11
:
-
2
]
import
sys
,
os
from
string
import
lower
,
atoi
,
rfind
,
strip
...
...
@@ -250,65 +250,65 @@ def get_module_info(module_name, modules={},
acquire
()
tb
=
None
try
:
try
:
module
=
__import__
(
module_name
,
globals
(),
globals
(),
(
'__doc__'
,))
realm
=
module_name
# Let the app specify a realm
if
hasattr
(
module
,
'__bobo_realm__'
):
realm
=
module
.
__bobo_realm__
elif
os
.
environ
.
has_key
(
'Z_REALM'
):
realm
=
os
.
environ
[
'Z_REALM'
]
elif
os
.
environ
.
has_key
(
'BOBO_REALM'
):
realm
=
os
.
environ
[
'BOBO_REALM'
]
else
:
realm
=
module_name
# Check for debug mode
if
hasattr
(
module
,
'__bobo_debug_mode__'
):
debug_mode
=
not
not
module
.
__bobo_debug_mode__
elif
(
os
.
environ
.
has_key
(
'Z_DEBUG_MODE'
)
or
os
.
environ
.
has_key
(
'BOBO_DEBUG_MODE'
)):
if
os
.
environ
.
has_key
(
'Z_DEBUG_MODE'
):
debug_mode
=
lower
(
os
.
environ
[
'Z_DEBUG_MODE'
])
else
:
debug_mode
=
lower
(
os
.
environ
[
'BOBO_DEBUG_MODE'
])
if
debug_mode
==
'y'
or
debug_mode
==
'yes'
:
debug_mode
=
1
else
:
try
:
debug_mode
=
atoi
(
debug_mode
)
except
:
debug_mode
=
None
else
:
debug_mode
=
None
if
hasattr
(
module
,
'__bobo_before__'
):
bobo_before
=
module
.
__bobo_before__
else
:
bobo_before
=
None
if
hasattr
(
module
,
'__bobo_after__'
):
bobo_after
=
module
.
__bobo_after__
else
:
bobo_after
=
None
if
hasattr
(
module
,
'bobo_application'
):
object
=
module
.
bobo_application
elif
hasattr
(
module
,
'web_objects'
):
object
=
module
.
web_objects
else
:
object
=
module
try
:
module
=
__import__
(
module_name
,
globals
(),
globals
(),
(
'__doc__'
,))
error_hook
=
getattr
(
module
,
'zpublisher_exception_hook'
,
None
)
realm
=
module_name
try
:
get_transaction
()
except
:
have_transactions
=
0
else
:
have_transactions
=
1
info
=
(
bobo_before
,
bobo_after
,
object
,
realm
,
debug_mode
,
error_hook
,
have_transactions
)
modules
[
module_name
]
=
modules
[
module_name
+
'.cgi'
]
=
info
# Let the app specify a realm
if
hasattr
(
module
,
'__bobo_realm__'
):
realm
=
module
.
__bobo_realm__
elif
os
.
environ
.
has_key
(
'Z_REALM'
):
realm
=
os
.
environ
[
'Z_REALM'
]
elif
os
.
environ
.
has_key
(
'BOBO_REALM'
):
realm
=
os
.
environ
[
'BOBO_REALM'
]
else
:
realm
=
module_name
# Check for debug mode
if
hasattr
(
module
,
'__bobo_debug_mode__'
):
debug_mode
=
not
not
module
.
__bobo_debug_mode__
elif
(
os
.
environ
.
has_key
(
'Z_DEBUG_MODE'
)
or
os
.
environ
.
has_key
(
'BOBO_DEBUG_MODE'
)):
if
os
.
environ
.
has_key
(
'Z_DEBUG_MODE'
):
debug_mode
=
lower
(
os
.
environ
[
'Z_DEBUG_MODE'
])
else
:
debug_mode
=
lower
(
os
.
environ
[
'BOBO_DEBUG_MODE'
])
if
debug_mode
==
'y'
or
debug_mode
==
'yes'
:
debug_mode
=
1
else
:
try
:
debug_mode
=
atoi
(
debug_mode
)
except
:
debug_mode
=
None
else
:
debug_mode
=
None
return
info
except
:
t
,
v
,
tb
=
sys
.
exc_info
()
v
=
str
(
v
)
raise
ImportError
,
(
t
,
v
),
tb
if
hasattr
(
module
,
'__bobo_before__'
):
bobo_before
=
module
.
__bobo_before__
else
:
bobo_before
=
None
if
hasattr
(
module
,
'__bobo_after__'
):
bobo_after
=
module
.
__bobo_after__
else
:
bobo_after
=
None
if
hasattr
(
module
,
'bobo_application'
):
object
=
module
.
bobo_application
elif
hasattr
(
module
,
'web_objects'
):
object
=
module
.
web_objects
else
:
object
=
module
error_hook
=
getattr
(
module
,
'zpublisher_exception_hook'
,
None
)
try
:
get_transaction
()
except
:
have_transactions
=
0
else
:
have_transactions
=
1
info
=
(
bobo_before
,
bobo_after
,
object
,
realm
,
debug_mode
,
error_hook
,
have_transactions
)
modules
[
module_name
]
=
modules
[
module_name
+
'.cgi'
]
=
info
return
info
except
:
t
,
v
,
tb
=
sys
.
exc_info
()
v
=
str
(
v
)
raise
ImportError
,
(
t
,
v
),
tb
finally
:
tb
=
None
release
()
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