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
c30005c4
Commit
c30005c4
authored
Jan 28, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved log.
Added new data type conversion options.
parent
eca3b9e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
174 additions
and
120 deletions
+174
-120
lib/python/ZPublisher/Publish.py
lib/python/ZPublisher/Publish.py
+174
-120
No files found.
lib/python/ZPublisher/Publish.py
View file @
c30005c4
...
@@ -249,15 +249,29 @@ Function, method, and class objects
...
@@ -249,15 +249,29 @@ Function, method, and class objects
string -- python strings
string -- python strings
Required -- non-blank python strings
regex -- Python case-sensitive regular expressions
regex -- Python case-sensitive regular expressions
Regex -- Python case-insensitive regular expressions
Regex -- Python case-insensitive regular expressions
regexs -- Multiple Python case-sensitive regular expressions
separated by spaces
Regexs -- Multiple Python case-insensitive regular expressions
separated by spaces
date -- Date-time values
date -- Date-time values
list -- Python list of values, even if there is only
list -- Python list of values, even if there is only
one value.
one value.
lines -- Python list of values entered as multiple lines
in a single field
tokens -- Python list of values entered as multiple space-separated
tokens in a single field
tuple -- Python tuple of values, even if there is only one.
tuple -- Python tuple of values, even if there is only one.
For example, if the name of a field in an input
For example, if the name of a field in an input
...
@@ -504,7 +518,7 @@ Publishing a module using Fast CGI
...
@@ -504,7 +518,7 @@ Publishing a module using Fast CGI
o Configure the Fast CGI-enabled web server to execute this
o Configure the Fast CGI-enabled web server to execute this
file.
file.
$Id: Publish.py,v 1.2
8 1997/01/08 23:22:45
jim Exp $"""
$Id: Publish.py,v 1.2
9 1997/01/28 23:02:49
jim Exp $"""
#'
#'
# Copyright
# Copyright
#
#
...
@@ -556,126 +570,9 @@ $Id: Publish.py,v 1.28 1997/01/08 23:22:45 jim Exp $"""
...
@@ -556,126 +570,9 @@ $Id: Publish.py,v 1.28 1997/01/08 23:22:45 jim Exp $"""
#
#
# (540) 371-6909
# (540) 371-6909
#
#
# $Log: Publish.py,v $
# See end of file for change log.
# Revision 1.28 1997/01/08 23:22:45 jim
# Added code to overcome Python 1.3 bug in string conversion functions.
#
# Revision 1.27 1996/12/30 14:36:12 jim
# Fixed a spelling error.
#
# Revision 1.26 1996/11/26 22:06:18 jim
# Added support for __bobo_before__ and __bobo_after__.
#
# 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
# intervening object does not use named groups.
#
# Added better string formating of requests.
#
# Revision 1.23 1996/10/28 22:13:45 jim
# Fixed bug in last fix.
#
# Revision 1.22 1996/10/25 19:34:27 jim
# Fixed bug in handling of import errors.
#
# Revision 1.21 1996/10/15 15:45:35 jim
# Added tuple argument type and enhances error handling.
#
# Revision 1.20 1996/09/16 14:43:27 jim
# Changes to make shutdown methods work properly. Now shutdown methods
# can simply sys.exit(0).
#
# Added on-line documentation and debugging support to bobo.
#
# Revision 1.19 1996/09/13 22:51:35 jim
# *** empty log message ***
#
# Revision 1.18 1996/08/30 23:40:40 jfulton
# Fixed bug in argument marshalling!!!
#
# Revision 1.17 1996/08/30 17:08:53 jfulton
# Disallowed index_html/index_html.
#
# Revision 1.16 1996/08/29 22:20:26 jfulton
# *** empty log message ***
#
# Revision 1.15 1996/08/07 19:37:54 jfulton
# Added:
#
# - Regex, regex input types,
# - New rule for acquiring allow groups,
# - Support for index_html attribute,
# - Support for relative base refs
# - Added URL as magic variable
# - Added error checking of typed fields
#
# Revision 1.14 1996/08/05 11:33:54 jfulton
# Added first cut at group composition.
#
# Revision 1.13 1996/07/25 16:42:48 jfulton
# - Added FileUpload objects.
# - Added logic to check for non-file fields in forms with file upload.
# - Added new type conversion types: string (esp for use with file-upload)
# and date.
#
# Revision 1.12 1996/07/25 12:39:09 jfulton
# Added support for __allow_groups__ method.
# Made auto-generation of realms smarter about realm names.
#
# Revision 1.11 1996/07/23 20:56:40 jfulton
# Updated the documentation.
#
# Revision 1.10 1996/07/23 20:48:55 jfulton
# Changed authorization model so that sub-object allow_groups override,
# rather than augment (tighten) parent groups.
#
#
# Note that now a valid group is None, which makes a subobject public,
__version__
=
'$Revision: 1.29 $'
[
11
:
-
2
]
# even a parent is protected.
#
# Revision 1.9 1996/07/23 19:59:29 jfulton
# Fixed bugs:
#
# - object[entryname] can fail with attribute as well as type error
# - flatten didn't work with multiple values\
# - inserted base was not absolute
#
# Added transaction support.
#
# Revision 1.8 1996/07/18 14:59:54 jfulton
# Fixed bug in getting web_objects.
#
# Revision 1.7 1996/07/11 19:39:07 jfulton
# Fixed bug in new feature: 'AUTHENTICATED_USER'
#
# Revision 1.6 1996/07/10 22:53:54 jfulton
# Fixed bug in use of default realm.
#
# If authentication is performed, then the name of the authenticated
# user is saved in the request with the name 'AUTHENTICATED_USER', and
# will be passed to called objects through the argument name
# 'AUTHENTICATED_USER'.
#
# Revision 1.5 1996/07/08 20:34:11 jfulton
# Many changes, including:
#
# - Better realm management
# - Automatic type conversion
# - Improved documentation
# - ...
#
# Revision 1.4 1996/07/04 22:57:20 jfulton
# Added lots of documentation. A few documented features have yet to be
# implemented. The module needs to be retested after adding some new
# features.
#
#
#
__version__
=
'$Revision: 1.28 $'
[
11
:
-
2
]
def
main
():
def
main
():
...
@@ -1130,6 +1027,12 @@ def field2string(v):
...
@@ -1130,6 +1027,12 @@ def field2string(v):
except
:
v
=
str
(
v
)
except
:
v
=
str
(
v
)
return
v
return
v
def
field2required
(
v
):
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
if
string
.
strip
(
v
):
return
v
raise
ValueError
,
'No input for required field'
def
field2int
(
v
):
def
field2int
(
v
):
try
:
v
=
v
.
read
()
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
except
:
v
=
str
(
v
)
...
@@ -1161,6 +1064,28 @@ def field2regex(v):
...
@@ -1161,6 +1064,28 @@ def field2regex(v):
except
:
v
=
str
(
v
)
except
:
v
=
str
(
v
)
if
v
:
return
regex
.
compile
(
v
,
regex
.
casefold
)
if
v
:
return
regex
.
compile
(
v
,
regex
.
casefold
)
def
field2Regexs
(
v
):
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
v
=
map
(
lambda
v
:
regex
.
compile
(
v
),
string
.
split
(
v
))
if
v
:
return
v
def
field2regexs
(
v
):
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
v
=
map
(
lambda
v
:
regex
.
compile
(
v
,
regex
.
casefold
),
string
.
split
(
v
))
if
v
:
return
v
def
field2tokens
(
v
):
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
return
string
.
split
(
v
)
def
field2lines
(
v
):
try
:
v
=
v
.
read
()
except
:
v
=
str
(
v
)
return
string
.
split
(
v
,
'
\
n
'
)
def
field2date
(
v
):
def
field2date
(
v
):
from
DateTime
import
DateTime
from
DateTime
import
DateTime
try
:
v
=
v
.
read
()
try
:
v
=
v
.
read
()
...
@@ -1279,6 +1204,11 @@ class Request:
...
@@ -1279,6 +1204,11 @@ class Request:
'tuple'
:
field2tuple
,
'tuple'
:
field2tuple
,
'regex'
:
field2regex
,
'regex'
:
field2regex
,
'Regex'
:
field2Regex
,
'Regex'
:
field2Regex
,
'regexs'
:
field2regexs
,
'Regexs'
:
field2Regexs
,
'Required'
:
field2Required
,
'tokens'
:
field2tokens
,
'lines'
:
field2lines
,
}
}
__http_colon
=
regex
.
compile
(
"
\
(:
\
|
\
(%
3
[aA]
\
)
\
)"
)
__http_colon
=
regex
.
compile
(
"
\
(:
\
|
\
(%
3
[aA]
\
)
\
)"
)
...
@@ -1467,3 +1397,127 @@ def publish_module(module_name,
...
@@ -1467,3 +1397,127 @@ def publish_module(module_name,
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
=
None
,
None
,
None
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
=
None
,
None
,
None
return
status
return
status
#
# $Log: Publish.py,v $
# Revision 1.29 1997/01/28 23:02:49 jim
# Moved log.
# Added new data type conversion options.
#
# Revision 1.28 1997/01/08 23:22:45 jim
# Added code to overcome Python 1.3 bug in string conversion functions.
#
# Revision 1.27 1996/12/30 14:36:12 jim
# Fixed a spelling error.
#
# Revision 1.26 1996/11/26 22:06:18 jim
# Added support for __bobo_before__ and __bobo_after__.
#
# 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
# intervening object does not use named groups.
#
# Added better string formating of requests.
#
# Revision 1.23 1996/10/28 22:13:45 jim
# Fixed bug in last fix.
#
# Revision 1.22 1996/10/25 19:34:27 jim
# Fixed bug in handling of import errors.
#
# Revision 1.21 1996/10/15 15:45:35 jim
# Added tuple argument type and enhances error handling.
#
# Revision 1.20 1996/09/16 14:43:27 jim
# Changes to make shutdown methods work properly. Now shutdown methods
# can simply sys.exit(0).
#
# Added on-line documentation and debugging support to bobo.
#
# Revision 1.19 1996/09/13 22:51:35 jim
# *** empty log message ***
#
# Revision 1.18 1996/08/30 23:40:40 jfulton
# Fixed bug in argument marshalling!!!
#
# Revision 1.17 1996/08/30 17:08:53 jfulton
# Disallowed index_html/index_html.
#
# Revision 1.16 1996/08/29 22:20:26 jfulton
# *** empty log message ***
#
# Revision 1.15 1996/08/07 19:37:54 jfulton
# Added:
#
# - Regex, regex input types,
# - New rule for acquiring allow groups,
# - Support for index_html attribute,
# - Support for relative base refs
# - Added URL as magic variable
# - Added error checking of typed fields
#
# Revision 1.14 1996/08/05 11:33:54 jfulton
# Added first cut at group composition.
#
# Revision 1.13 1996/07/25 16:42:48 jfulton
# - Added FileUpload objects.
# - Added logic to check for non-file fields in forms with file upload.
# - Added new type conversion types: string (esp for use with file-upload)
# and date.
#
# Revision 1.12 1996/07/25 12:39:09 jfulton
# Added support for __allow_groups__ method.
# Made auto-generation of realms smarter about realm names.
#
# Revision 1.11 1996/07/23 20:56:40 jfulton
# Updated the documentation.
#
# Revision 1.10 1996/07/23 20:48:55 jfulton
# Changed authorization model so that sub-object allow_groups override,
# rather than augment (tighten) parent groups.
#
# Note that now a valid group is None, which makes a subobject public,
# even a parent is protected.
#
# Revision 1.9 1996/07/23 19:59:29 jfulton
# Fixed bugs:
#
# - object[entryname] can fail with attribute as well as type error
# - flatten didn't work with multiple values\
# - inserted base was not absolute
#
# Added transaction support.
#
# Revision 1.8 1996/07/18 14:59:54 jfulton
# Fixed bug in getting web_objects.
#
# Revision 1.7 1996/07/11 19:39:07 jfulton
# Fixed bug in new feature: 'AUTHENTICATED_USER'
#
# Revision 1.6 1996/07/10 22:53:54 jfulton
# Fixed bug in use of default realm.
#
# If authentication is performed, then the name of the authenticated
# user is saved in the request with the name 'AUTHENTICATED_USER', and
# will be passed to called objects through the argument name
# 'AUTHENTICATED_USER'.
#
# Revision 1.5 1996/07/08 20:34:11 jfulton
# Many changes, including:
#
# - Better realm management
# - Automatic type conversion
# - Improved documentation
# - ...
#
# Revision 1.4 1996/07/04 22:57:20 jfulton
# Added lots of documentation. A few documented features have yet to be
# implemented. The module needs to be retested after adding some new
# features.
#
#
#
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