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
7a9f9e16
Commit
7a9f9e16
authored
Nov 02, 2014
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deal with a couple more func_code/func_defaults vs. double under code/defaults
parent
f1a9a52e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
23 deletions
+30
-23
src/App/special_dtml.py
src/App/special_dtml.py
+10
-8
src/Products/PageTemplates/PageTemplateFile.py
src/Products/PageTemplates/PageTemplateFile.py
+2
-2
src/Products/PageTemplates/ZopePageTemplate.py
src/Products/PageTemplates/ZopePageTemplate.py
+2
-2
src/Shared/DC/Scripts/Script.py
src/Shared/DC/Scripts/Script.py
+2
-2
src/Shared/DC/Scripts/Signature.py
src/Shared/DC/Scripts/Signature.py
+13
-8
src/ZPublisher/Client.py
src/ZPublisher/Client.py
+1
-1
No files found.
src/App/special_dtml.py
View file @
7a9f9e16
...
...
@@ -36,12 +36,14 @@ class HTML(DocumentTemplate.HTML,Persistence.Persistent,):
class
ClassicHTMLFile
(
DocumentTemplate
.
HTMLFile
,
MethodObject
.
Method
,):
"Persistent HTML Document Templates read from files"
class
func_code
:
pass
func_code
=
func_code
()
func_code
.
co_varnames
=
'trueself'
,
'self'
,
'REQUEST'
func_code
.
co_argcount
=
3
_need__name__
=
1
_v_last_read
=
0
class
func_code
:
pass
func_code
=
__code__
=
func_code
()
func_code
.
co_varnames
=
'trueself'
,
'self'
,
'REQUEST'
func_code
.
co_argcount
=
3
_need__name__
=
1
_v_last_read
=
0
def
__init__
(
self
,
name
,
_prefix
=
None
,
**
kw
):
if
_prefix
is
None
:
...
...
@@ -92,8 +94,8 @@ from ComputedAttribute import ComputedAttribute
class
DTMLFile
(
Bindings
,
Explicit
,
ClassicHTMLFile
):
"HTMLFile with bindings and support for __render_with_namespace__"
func_code
=
None
func_defaults
=
None
func_code
=
__code__
=
None
func_defaults
=
__defaults__
=
None
_need__name__
=
1
_Bindings_ns_class
=
TemplateDict
...
...
src/Products/PageTemplates/PageTemplateFile.py
View file @
7a9f9e16
...
...
@@ -51,8 +51,8 @@ class PageTemplateFile(SimpleItem, Script, PageTemplate, Traversable):
meta_type
=
'Page Template (File)'
func_defaults
=
None
func_code
=
FuncCode
((),
0
)
func_defaults
=
__defaults__
=
None
func_code
=
__code__
=
FuncCode
((),
0
)
_v_last_read
=
0
# needed by AccessControl.class_init.InitializeClass
...
...
src/Products/PageTemplates/ZopePageTemplate.py
View file @
7a9f9e16
...
...
@@ -75,8 +75,8 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
meta_type
=
'Page Template'
output_encoding
=
'utf-8'
# provide default for old instances
func_defaults
=
None
func_code
=
FuncCode
((),
0
)
func_defaults
=
__defaults__
=
None
func_code
=
__code__
=
FuncCode
((),
0
)
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
_default_content_fn
=
os
.
path
.
join
(
package_home
(
globals
()),
...
...
src/Shared/DC/Scripts/Script.py
View file @
7a9f9e16
...
...
@@ -38,8 +38,8 @@ class Script(SimpleItem, BindingsUI):
security
=
ClassSecurityInfo
()
index_html
=
None
func_defaults
=
()
func_code
=
None
func_defaults
=
__defaults__
=
()
func_code
=
__code__
=
None
_Bindings_ns_class
=
TemplateDict
...
...
src/Shared/DC/Scripts/Signature.py
View file @
7a9f9e16
...
...
@@ -15,27 +15,32 @@
This provides support for simulating function signatures
"""
class
FuncCode
:
def
__init__
(
self
,
varnames
,
argcount
):
self
.
co_varnames
=
varnames
self
.
co_argcount
=
argcount
self
.
co_varnames
=
varnames
self
.
co_argcount
=
argcount
def
__cmp__
(
self
,
other
):
if
other
is
None
:
return
1
try
:
return
cmp
((
self
.
co_argcount
,
self
.
co_varnames
),
if
other
is
None
:
return
1
try
:
return
cmp
((
self
.
co_argcount
,
self
.
co_varnames
),
(
other
.
co_argcount
,
other
.
co_varnames
))
except
:
return
1
except
Exception
:
return
1
# This is meant to be imported directly into a class.
def
_setFuncSignature
(
self
,
defaults
=
None
,
varnames
=
(),
argcount
=-
1
):
# Simplify calls.
if
argcount
<
0
and
varnames
:
argcount
=
len
(
varnames
)
# Generate a change only if we have to.
if
self
.
func_defaults
!=
defaults
:
self
.
func_defaults
=
defaults
self
.
func_defaults
=
self
.
__defaults__
=
defaults
code
=
FuncCode
(
varnames
,
argcount
)
if
self
.
func_code
!=
code
:
self
.
func_code
=
code
self
.
func_code
=
self
.
__code__
=
code
src/ZPublisher/Client.py
View file @
7a9f9e16
...
...
@@ -63,7 +63,7 @@ class Function:
headers
[
'Host'
]
=
urlparse
(
url
)[
1
]
self
.
func_name
=
url
[
url
.
rfind
(
'/'
)
+
1
:]
self
.
__dict__
[
'__name__'
]
=
self
.
func_name
self
.
func_defaults
=
()
self
.
func_defaults
=
self
.
__defaults__
=
()
self
.
args
=
arguments
...
...
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