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
474917d0
Commit
474917d0
authored
Nov 06, 1996
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to return status code from publish method.
This is needed by the Bobo server.
parent
86eb9ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
lib/python/ZPublisher/Publish.py
lib/python/ZPublisher/Publish.py
+25
-16
No files found.
lib/python/ZPublisher/Publish.py
View file @
474917d0
...
...
@@ -516,7 +516,7 @@ Publishing a module using the ILU Requestor (future)
o Configure the web server to call module_name@server_name with
the requestor.
$Id: Publish.py,v 1.2
4 1996/10/29 19:21:43
jim Exp $"""
$Id: Publish.py,v 1.2
5 1996/11/06 14:27:09
jim Exp $"""
#'
# Copyright
#
...
...
@@ -569,6 +569,10 @@ $Id: Publish.py,v 1.24 1996/10/29 19:21:43 jim Exp $"""
# (540) 371-6909
#
# $Log: Publish.py,v $
# Revision 1.25 1996/11/06 14:27:09 jim
# Added logic to return status code from publish method.
# This is needed by the Bobo server.
#
# Revision 1.24 1996/10/29 19:21:43 jim
# Changed rule (and terminology) for acquiring authorization data
# so that a subobject can aquire data from a container even if an
...
...
@@ -674,7 +678,7 @@ $Id: Publish.py,v 1.24 1996/10/29 19:21:43 jim Exp $"""
#
#
#
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
def
main
():
...
...
@@ -760,6 +764,12 @@ class ModulePublisher:
raise
'Unauthorized'
,
v
self
.
forbiddenError
()
def
get_request_data
(
self
,
request_params
):
try
:
request_params
=
request_params
()
except
:
pass
for
key
in
request_params
.
keys
():
self
.
request
[
key
]
=
request_params
[
key
]
def
publish
(
self
,
module_name
,
published
=
'web_objects'
,
imported_modules
=
{},
module_dicts
=
{},
debug
=
0
):
...
...
@@ -801,6 +811,12 @@ class ModulePublisher:
try
:
realm
=
theModule
.
__realm__
except
:
realm
=
None
# Get request data from outermost environment:
try
:
request_params
=
theModule
.
__request_data__
self
.
get_request_data
(
request_params
)
except
:
pass
# Get initial group data:
default_inherited_groups
=
{
None
:
None
}
inherited_groups
=
default_inherited_groups
...
...
@@ -883,15 +899,7 @@ class ModulePublisher:
except
:
pass
try
:
request_params
=
getattr
(
subobject
,
'__request_data__'
)
# bleh, test gets around Python bug:
if
not
(
type
(
request_params
)
is
types
.
MethodType
and
type
(
subobject
)
is
types
.
ClassType
):
try
:
request_params
=
request_params
()
except
:
pass
for
key
in
request_params
.
keys
():
self
.
request
[
key
]
=
request_params
[
key
]
self
.
get_request_data
(
request_params
)
except
:
pass
except
AttributeError
:
try
:
...
...
@@ -904,10 +912,7 @@ class ModulePublisher:
try
:
request_params
=
getattr
(
subobject
,
'__request_data__'
)
try
:
request_params
=
request_params
()
except
:
pass
for
key
in
request_params
.
keys
():
self
.
request
[
key
]
=
request_params
[
key
]
self
.
get_request_data
(
request_params
)
except
:
pass
try
:
groups
=
subobject
.
__allow_groups__
...
...
@@ -1418,6 +1423,7 @@ def publish_module(module_name,
stdin
=
sys
.
stdin
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
,
environ
=
os
.
environ
,
debug
=
0
):
must_die
=
0
status
=
200
try
:
response
=
Response
(
stdout
=
stdout
,
stderr
=
stderr
)
publisher
=
CGIModulePublisher
(
stdin
=
stdin
,
stdout
=
stdout
,
...
...
@@ -1434,10 +1440,13 @@ def publish_module(module_name,
must_die
=
1
response
.
exception
(
must_die
)
except
:
status
=
response
.
getStatus
()
response
.
exception
()
if
response
:
response
=
str
(
response
)
if
response
:
response
=
str
(
response
)
if
response
:
stdout
.
write
(
response
)
if
must_die
:
raise
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
=
None
,
None
,
None
return
status
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