Commit f7e8342e authored by Evan Simpson's avatar Evan Simpson

Give read() and write() docstrings so they are xmlrpc-callable.

parent a0731f07
...@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted ...@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted
Python code. Python code.
""" """
__version__='$Revision: 1.24 $'[11:-2] __version__='$Revision: 1.25 $'[11:-2]
import sys, os, traceback, re import sys, os, traceback, re
from Globals import DTMLFile, MessageDialog from Globals import DTMLFile, MessageDialog
...@@ -397,6 +397,7 @@ class PythonScript(Script, Historical, Cacheable): ...@@ -397,6 +397,7 @@ class PythonScript(Script, Historical, Cacheable):
manage_FTPput = PUT manage_FTPput = PUT
def write(self, text): def write(self, text):
""" Change the Script by parsing a read()-style source text. """
self._validateProxy() self._validateProxy()
mdata = self._metadata_map() mdata = self._metadata_map()
bindmap = self.getBindingAssignments().getAssignedNames() bindmap = self.getBindingAssignments().getAssignedNames()
...@@ -468,6 +469,11 @@ class PythonScript(Script, Historical, Cacheable): ...@@ -468,6 +469,11 @@ class PythonScript(Script, Historical, Cacheable):
return m return m
def read(self): def read(self):
""" Generate a text representation of the Script source.
Includes specially formatted comment lines for parameters,
bindings, and the title.
"""
# Construct metadata header lines, indented the same as the body. # Construct metadata header lines, indented the same as the body.
m = _first_indent.search(self._body) m = _first_indent.search(self._body)
if m: prefix = m.group(0) + '##' if m: prefix = m.group(0) + '##'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment