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
c51ebf9c
Commit
c51ebf9c
authored
Oct 02, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added :default_method form variable type.
parent
e3605d32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
lib/python/ZPublisher/Publish.py
lib/python/ZPublisher/Publish.py
+21
-12
No files found.
lib/python/ZPublisher/Publish.py
View file @
c51ebf9c
...
@@ -353,6 +353,10 @@ Function, method, and class objects
...
@@ -353,6 +353,10 @@ Function, method, and class objects
Only one method field should be provided. If more than one method
Only one method field should be provided. If more than one method
field is included in the request, the behavior is undefined.
field is included in the request, the behavior is undefined.
If the name of a form field is ':default_method', then the value
of the field is added to 'PATH_INFO' *if and only if* there are no
form fields with names ending in ':method'.
The base HREF is set when method fields are provided. In the
The base HREF is set when method fields are provided. In the
above examples, the base HREF is set to '.../foo/bar/x'. Of
above examples, the base HREF is set to '.../foo/bar/x'. Of
course, if, in this example, 'y' was an object with an index_html
course, if, in this example, 'y' was an object with an index_html
...
@@ -478,11 +482,11 @@ Publishing a module using CGI
...
@@ -478,11 +482,11 @@ Publishing a module using CGI
containing the module to be published) to the module name in the
containing the module to be published) to the module name in the
cgi-bin directory.
cgi-bin directory.
$Id: Publish.py,v 1.10
2 1998/09/25 15:14:49
jim Exp $"""
$Id: Publish.py,v 1.10
3 1998/10/02 19:42:10
jim Exp $"""
#'
#'
#
#
##########################################################################
##########################################################################
__version__
=
'$Revision: 1.10
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.10
3
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
cgi
,
regex
import
sys
,
os
,
string
,
cgi
,
regex
from
string
import
*
from
string
import
*
...
@@ -556,6 +560,7 @@ class ModulePublisher:
...
@@ -556,6 +560,7 @@ class ModulePublisher:
type_search
=
type_re
.
search
type_search
=
type_re
.
search
lt
=
type
([])
lt
=
type
([])
CGI_name
=
isCGI_NAME
CGI_name
=
isCGI_NAME
meth
=
None
for
item
in
fslist
:
for
item
in
fslist
:
key
=
unquote
(
item
.
name
)
key
=
unquote
(
item
.
name
)
...
@@ -581,15 +586,12 @@ class ModulePublisher:
...
@@ -581,15 +586,12 @@ class ModulePublisher:
seqf
=
tuple
seqf
=
tuple
tuple_items
[
key
]
=
1
tuple_items
[
key
]
=
1
elif
type_name
==
'method'
:
elif
type_name
==
'method'
:
if
environ
.
has_key
(
'PATH_INFO'
):
if
l
:
meth
=
key
path
=
environ
[
'PATH_INFO'
]
else
:
meth
=
item
while
path
[
-
1
:]
==
'/'
:
path
=
path
[:
-
1
]
elif
type_name
==
'default_method'
:
else
:
path
=
''
if
not
meth
:
if
l
:
m
=
key
if
l
:
meth
=
key
else
:
m
=
item
else
:
meth
=
item
path
=
"%s/%s"
%
(
path
,
m
)
other
[
'PATH_INFO'
]
=
path
self
.
_hacked_path
=
1
else
:
else
:
item
=
type_converters
[
type_name
](
item
)
item
=
type_converters
[
type_name
](
item
)
l
=
type_search
(
key
)
l
=
type_search
(
key
)
...
@@ -614,10 +616,17 @@ class ModulePublisher:
...
@@ -614,10 +616,17 @@ class ModulePublisher:
form
[
key
]
=
item
form
[
key
]
=
item
other
[
key
]
=
item
other
[
key
]
=
item
if
meth
:
if
environ
.
has_key
(
'PATH_INFO'
):
path
=
environ
[
'PATH_INFO'
]
while
path
[
-
1
:]
==
'/'
:
path
=
path
[:
-
1
]
else
:
path
=
''
other
[
'PATH_INFO'
]
=
path
=
"%s/%s"
%
(
path
,
meth
)
self
.
_hacked_path
=
1
# Cookie values should *not* be appended to existing form
# Cookie values should *not* be appended to existing form
# vars with the same name - they are more like default values
# vars with the same name - they are more like default values
# for names not otherwise specified in the form.
# for names not otherwise specified in the form.
cookies
=
{}
cookies
=
{}
if
environ
.
has_key
(
'HTTP_COOKIE'
):
if
environ
.
has_key
(
'HTTP_COOKIE'
):
parse_cookie
(
self
.
environ
[
'HTTP_COOKIE'
],
cookies
)
parse_cookie
(
self
.
environ
[
'HTTP_COOKIE'
],
cookies
)
...
...
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