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
e7515c33
Commit
e7515c33
authored
Apr 14, 2010
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-synced publish_module with Publish.publish_module_standard
parent
84deecad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
src/ZPublisher/Test.py
src/ZPublisher/Test.py
+31
-20
No files found.
src/ZPublisher/Test.py
View file @
e7515c33
...
@@ -99,7 +99,6 @@ DONE_STRING_DEFAULT = '\n%s\n\n' % ('_'*60)
...
@@ -99,7 +99,6 @@ DONE_STRING_DEFAULT = '\n%s\n\n' % ('_'*60)
import
sys
,
traceback
,
profile
,
os
,
getopt
import
sys
,
traceback
,
profile
,
os
,
getopt
from
time
import
clock
from
time
import
clock
repeat_count
=
100
repeat_count
=
100
TupleType
=
type
(())
def
main
():
def
main
():
import
sys
,
os
,
getopt
import
sys
,
os
,
getopt
...
@@ -181,6 +180,8 @@ def publish_module(module_name,
...
@@ -181,6 +180,8 @@ def publish_module(module_name,
from
Response
import
Response
from
Response
import
Response
from
Request
import
Request
from
Request
import
Request
from
Publish
import
publish
from
Publish
import
publish
from
zope.publisher.interfaces
import
ISkinnable
from
zope.publisher.skinnable
import
setDefaultSkin
try
:
try
:
try
:
try
:
if
response
is
None
:
if
response
is
None
:
...
@@ -192,31 +193,31 @@ def publish_module(module_name,
...
@@ -192,31 +193,31 @@ def publish_module(module_name,
if
request
is
None
:
if
request
is
None
:
request
=
Request
(
stdin
,
environ
,
response
)
request
=
Request
(
stdin
,
environ
,
response
)
# make sure that the request we hand over has the
# default layer/skin set on it; subsequent code that
# make sure that the request we hand over has the
# wants to look up views will likely depend on it
# default layer/skin set on it; subsequent code that
from
zope.publisher.interfaces
import
ISkinnable
# wants to look up views will likely depend on it
from
zope.publisher.skinnable
import
setDefaultSkin
if
ISkinnable
.
providedBy
(
request
):
if
ISkinnable
.
providedBy
(
request
):
setDefaultSkin
(
request
)
setDefaultSkin
(
request
)
for
k
,
v
in
extra
.
items
():
request
[
k
]
=
v
for
k
,
v
in
extra
.
items
():
request
[
k
]
=
v
response
=
publish
(
request
,
module_name
,
after_list
,
debug
=
debug
)
response
=
publish
(
request
,
module_name
,
after_list
,
debug
=
debug
)
except
SystemExit
,
v
:
except
(
SystemExit
,
ImportError
):
must_die
=
sys
.
exc_info
()
must_die
=
sys
.
exc_info
()
response
.
exception
(
must_die
)
request
.
response
.
exception
(
1
)
except
ImportError
,
v
:
if
isinstance
(
v
,
TupleType
)
and
len
(
v
)
==
3
:
must_die
=
v
else
:
must_die
=
sys
.
exc_info
()
response
.
exception
(
1
,
v
)
except
:
except
:
if
debug
:
if
debug
:
raise
raise
response
.
exception
()
request
.
response
.
exception
()
status
=
response
.
getStatus
()
status
=
response
.
getStatus
()
if
response
:
if
response
:
response
=
str
(
response
)
outputBody
=
getattr
(
response
,
'outputBody'
,
None
)
if
response
:
stdout
.
write
(
response
)
if
outputBody
is
not
None
:
outputBody
()
else
:
response
=
str
(
response
)
if
response
:
stdout
.
write
(
response
)
# The module defined a post-access function, call it
# The module defined a post-access function, call it
if
after_list
[
0
]
is
not
None
:
after_list
[
0
]()
if
after_list
[
0
]
is
not
None
:
after_list
[
0
]()
...
@@ -225,6 +226,16 @@ def publish_module(module_name,
...
@@ -225,6 +226,16 @@ def publish_module(module_name,
if
request
is
not
None
:
request
.
close
()
if
request
is
not
None
:
request
.
close
()
if
must_die
:
if
must_die
:
# Try to turn exception value into an exit code.
try
:
if
hasattr
(
must_die
[
1
],
'code'
):
code
=
must_die
[
1
].
code
else
:
code
=
int
(
must_die
[
1
])
except
:
code
=
must_die
[
1
]
and
1
or
0
if
hasattr
(
request
.
response
,
'_requestShutdown'
):
request
.
response
.
_requestShutdown
(
code
)
try
:
raise
must_die
[
0
],
must_die
[
1
],
must_die
[
2
]
try
:
raise
must_die
[
0
],
must_die
[
1
],
must_die
[
2
]
finally
:
must_die
=
None
finally
:
must_die
=
None
...
@@ -354,7 +365,7 @@ def publish(script=None,path_info='/',
...
@@ -354,7 +365,7 @@ def publish(script=None,path_info='/',
if
b
:
exec
b
in
dbdata
if
b
:
exec
b
in
dbdata
for
b
in
dbdata
[
'breakpoints'
]:
for
b
in
dbdata
[
'breakpoints'
]:
if
isinstance
(
b
,
TupleTyp
e
):
if
isinstance
(
b
,
tupl
e
):
apply
(
db
.
set_break
,
b
)
apply
(
db
.
set_break
,
b
)
else
:
else
:
fbreak
(
db
,
b
)
fbreak
(
db
,
b
)
...
...
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