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
297f6dd0
Commit
297f6dd0
authored
Apr 25, 2002
by
Toby Dickenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better docstrings, and added missing ZPL to ustr.py
parent
c78ee0c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
lib/python/DocumentTemplate/cDocumentTemplate.c
lib/python/DocumentTemplate/cDocumentTemplate.c
+4
-4
lib/python/DocumentTemplate/ustr.py
lib/python/DocumentTemplate/ustr.py
+16
-1
No files found.
lib/python/DocumentTemplate/cDocumentTemplate.c
View file @
297f6dd0
...
...
@@ -12,7 +12,7 @@
****************************************************************************/
static
char
cDocumentTemplate_module_documentation
[]
=
""
"
\n
$Id: cDocumentTemplate.c,v 1.4
4 2002/03/27 10:14:02
htrd Exp $"
"
\n
$Id: cDocumentTemplate.c,v 1.4
5 2002/04/25 12:45:11
htrd Exp $"
;
#include "ExtensionClass.h"
...
...
@@ -930,9 +930,9 @@ static struct PyMethodDef Module_Level__methods[] = {
{
"render_blocks"
,
(
PyCFunction
)
render_blocks
,
METH_VARARGS
,
""
},
{
"join_unicode"
,
(
PyCFunction
)
join_unicode
,
METH_VARARGS
,
"join a list of plain strings into a single plain string,"
"a list of unicode strings into a single unicode strings,"
"or a list containing a mix into a single unicode string with"
"join a list of plain strings into a single plain string,
\n
"
"a list of unicode strings into a single unicode strings,
\n
"
"or a list containing a mix into a single unicode string with
\n
"
"the plain strings converted from latin-1"
},
{
"safe_callable"
,
(
PyCFunction
)
safe_callable
,
METH_VARARGS
,
"callable() with a workaround for a problem with ExtensionClasses
\n
"
...
...
lib/python/DocumentTemplate/ustr.py
View file @
297f6dd0
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from
types
import
StringType
,
UnicodeType
,
InstanceType
nasty_exception_str
=
Exception
.
__str__
.
im_func
def
ustr
(
v
):
"""convert an object to a plain string or unicode string
"""Convert any object to a plain string or unicode string,
minimising the chance of raising a UnicodeError. This
even works with uncooperative objects like Exceptions
"""
string_types
=
(
StringType
,
UnicodeType
)
if
type
(
v
)
in
string_types
:
...
...
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