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
1cea895e
Commit
1cea895e
authored
Feb 23, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If an ExternalMethod takes a single arguments, named self, and is
called with no arguments, then aq_self is passed.
parent
aacf39b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
lib/python/Products/ExternalMethod/ExternalMethod.py
lib/python/Products/ExternalMethod/ExternalMethod.py
+14
-4
No files found.
lib/python/Products/ExternalMethod/ExternalMethod.py
View file @
1cea895e
...
...
@@ -5,7 +5,7 @@ This product provides support for external methods, which allow
domain-specific customization of web environments.
"""
from
Acquisition
import
Im
plicit
from
Acquisition
import
Ex
plicit
from
Globals
import
Persistent
,
HTMLFile
,
MessageDialog
import
OFS.SimpleItem
,
os
from
string
import
split
,
join
...
...
@@ -22,7 +22,7 @@ def manage_addExternalMethod(self, id, title, module, function, REQUEST=None):
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
class
ExternalMethod
(
OFS
.
SimpleItem
.
Item
,
Persistent
,
class
ExternalMethod
(
OFS
.
SimpleItem
.
Item
,
Persistent
,
Explicit
,
AccessControl
.
Role
.
RoleManager
):
"""An external method is a web-callable function that encapsulates
an external function."""
...
...
@@ -95,11 +95,21 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent,
return
f
__call____roles__
=
'Manager'
,
'Shared'
def
__call__
(
self
,
*
args
):
def
__call__
(
self
,
*
args
,
**
kw
):
try
:
f
=
self
.
_v_f
except
:
f
=
self
.
getFunction
()
return
apply
(
f
,
args
)
__traceback_info__
=
args
,
kw
,
self
.
func_defaults
try
:
return
apply
(
f
,
args
,
kw
)
except
TypeError
,
v
:
if
(
not
args
and
self
.
func_code
.
co_argcount
-
len
(
self
.
func_defaults
or
())
==
1
and
self
.
func_code
.
co_varnames
[
0
]
==
'self'
):
args
=
self
.
aq_parent
,
return
apply
(
f
,
args
,
kw
)
raise
TypeError
,
v
def
function
(
self
):
return
self
.
_function
def
module
(
self
):
return
self
.
_module
...
...
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