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
2acdfa26
Commit
2acdfa26
authored
Dec 15, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved function masquerating data to class from instance.
parent
f5e4768a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
lib/python/DocumentTemplate/DT_String.py
lib/python/DocumentTemplate/DT_String.py
+7
-7
lib/python/OFS/Document.py
lib/python/OFS/Document.py
+7
-8
No files found.
lib/python/DocumentTemplate/DT_String.py
View file @
2acdfa26
...
...
@@ -9,6 +9,13 @@ class String:
__doc__
=
DT_Doc
.
String__doc__
isDocTemp
=
1
# Document Templates masquerade as functions:
class
func_code
:
pass
func_code
=
func_code
()
func_code
.
co_varnames
=
'self'
,
'REQUEST'
func_code
.
co_argcount
=
2
func_defaults
=
()
def
errQuote
(
self
,
s
):
return
s
def
parse_error
(
self
,
mess
,
tag
,
text
,
start
):
...
...
@@ -245,9 +252,7 @@ class String:
if globals:
for k in globals.keys():
if k[:1] != '_' and not vars.has_key(k): vars[k]=globals[k]
self.func_defaults=()
self.globals=vars
self.func_code=func_code()
self._vars={}
__state_names__=('raw', 'globals', '__name__', '_vars')
...
...
@@ -410,8 +415,3 @@ class File(FileMixin, String):
"""
def manage_edit(self,data): raise TypeError, 'cannot edit files'
class func_code:
def __init__(self,varnames=('self','REQUEST')):
self.co_varnames=varnames
self.co_argcount=len(varnames)
lib/python/OFS/Document.py
View file @
2acdfa26
"""Document object"""
__version__
=
'$Revision: 1.
29
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
30
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
...
...
@@ -15,6 +15,12 @@ class Document(HTML, RoleManager, SimpleItem.Item_w__name__,
icon
=
'OFS/Document_icon.gif'
__state_names__
=
HTML
.
__state_names__
+
(
'title'
,
'__roles__'
)
# Documents masquerade as functions:
class
func_code
:
pass
func_code
=
func_code
()
func_code
.
co_varnames
=
'self'
,
'REQUEST'
,
'RESPONSE'
func_code
.
co_argcount
=
3
manage_options
=
({
'icon'
:
''
,
'label'
:
'Edit'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
},
...
...
@@ -29,13 +35,6 @@ class Document(HTML, RoleManager, SimpleItem.Item_w__name__,
},
)
def
initvars
(
self
,
mapping
,
vars
):
"""Hook to override signature so we can detect whether we are
running from the web"""
HTML
.
initvars
(
self
,
mapping
,
vars
)
self
.
func_code
.
__init__
((
'self'
,
'REQUEST'
,
'RESPONSE'
))
self
.
func_defaults
=
(
None
,)
def
__call__
(
self
,
client
=
None
,
REQUEST
=
{},
RESPONSE
=
None
,
**
kw
):
kw
[
'document_id'
]
=
self
.
id
kw
[
'document_title'
]
=
self
.
title
...
...
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