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
cf2042ee
Commit
cf2042ee
authored
Feb 07, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced string module calls by string methods
parent
8f12e4a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
23 deletions
+21
-23
lib/python/HelpSys/APIHelpTopic.py
lib/python/HelpSys/APIHelpTopic.py
+9
-10
lib/python/HelpSys/HelpTopic.py
lib/python/HelpSys/HelpTopic.py
+1
-2
lib/python/HelpSys/HelpUtil.py
lib/python/HelpSys/HelpUtil.py
+9
-9
lib/python/HelpSys/ObjectRef.py
lib/python/HelpSys/ObjectRef.py
+2
-2
No files found.
lib/python/HelpSys/APIHelpTopic.py
View file @
cf2042ee
...
...
@@ -15,7 +15,6 @@ API documentation help topics
"""
import
types
import
string
import
HelpTopic
from
Globals
import
DTMLFile
,
Persistent
...
...
@@ -59,12 +58,12 @@ class APIHelpTopic(HelpTopic.HelpTopic):
# try to get title from first non-blank line
# of module docstring
if
not
self
.
title
:
lines
=
s
tring
.
split
(
self
.
doc
,
'
\
n
'
)
lines
=
s
elf
.
doc
.
split
(
'
\
n
'
)
while
1
:
line
=
string
.
strip
(
lines
[
0
]
)
line
=
lines
[
0
].
strip
(
)
if
line
:
# get rid of anything after a colon in the line
self
.
title
=
string
.
split
(
line
,
':'
)[
0
]
self
.
title
=
line
.
split
(
':'
)[
0
]
break
lines
.
pop
(
0
)
if
not
lines
:
...
...
@@ -140,7 +139,7 @@ class APIDoc(Persistent):
if
hasattr
(
klass
,
'__extends__'
):
self
.
extends
=
[]
for
base
in
klass
.
__extends__
:
names
=
string
.
split
(
base
,
'.'
)
names
=
base
.
split
(
'.'
)
url
=
"%s/Help/%s.py#%s"
%
(
names
[
0
],
names
[
1
],
names
[
2
])
self
.
extends
.
append
((
names
[
2
],
url
))
...
...
@@ -255,20 +254,20 @@ def trim_doc_string(text):
Trims a doc string to make it format
correctly with structured text.
"""
text
=
string
.
strip
(
text
)
text
=
string
.
replace
(
text
,
'
\
r
\
n
'
,
'
\
n
'
)
lines
=
string
.
split
(
text
,
'
\
n
'
)
text
=
text
.
strip
(
)
text
=
text
.
replace
(
'
\
r
\
n
'
,
'
\
n
'
)
lines
=
text
.
split
(
'
\
n
'
)
nlines
=
[
lines
[
0
]]
if
len
(
lines
)
>
1
:
min_indent
=
None
for
line
in
lines
[
1
:]:
if
not
line
:
continue
indent
=
len
(
line
)
-
len
(
string
.
lstrip
(
line
))
indent
=
len
(
line
)
-
len
(
line
.
lstrip
(
))
if
indent
<
min_indent
or
min_indent
is
None
:
min_indent
=
indent
for
line
in
lines
[
1
:]:
nlines
.
append
(
line
[
min_indent
:])
return
string
.
join
(
nlines
,
'
\
n
'
)
return
'
\
n
'
.
join
(
nlines
)
lib/python/HelpSys/HelpTopic.py
View file @
cf2042ee
...
...
@@ -18,7 +18,6 @@ from Globals import Persistent, HTML, DTMLFile, ImageFile
from
OFS.DTMLDocument
import
DTMLDocument
from
OFS.PropertyManager
import
PropertyManager
import
os.path
import
string
import
Globals
class
HelpTopicBase
:
...
...
@@ -71,7 +70,7 @@ class HelpTopicBase:
def
url
(
self
):
"URL for indexing purposes"
return
string
.
join
(
self
.
getPhysicalPath
(),
'/'
)
return
'/'
.
join
(
self
.
getPhysicalPath
()
)
# Private indexing methods
# ------------------------
...
...
lib/python/HelpSys/HelpUtil.py
View file @
cf2042ee
...
...
@@ -12,12 +12,12 @@
##############################################################################
"""Help system support module"""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
Globals
,
Acquisition
import
StructuredText.StructuredText
import
sys
,
os
,
string
,
re
import
sys
,
os
,
re
stx_class
=
StructuredText
.
StructuredText
.
HTML
...
...
@@ -70,11 +70,11 @@ class object(Acquisition.Implicit):
def
get_docstring_html
(
self
):
doc
=
self
.
get_docstring
()
if
string
.
find
(
doc
,
'
\
n
\
n
'
)
>
-
1
:
doc
=
string
.
split
(
doc
,
'
\
n
\
n
'
)
if
doc
.
find
(
'
\
n
\
n
'
)
>
-
1
:
doc
=
doc
.
split
(
'
\
n
\
n
'
)
if
len
(
doc
)
>
1
:
doc
[
1
]
=
string
.
strip
(
doc
[
1
]
)
doc
=
string
.
join
(
doc
,
'
\
n
\
n
'
)
doc
[
1
]
=
doc
[
1
].
strip
(
)
doc
=
'
\
n
\
n
'
.
join
(
doc
)
return
str
(
stx_class
(
doc
))
...
...
@@ -233,7 +233,7 @@ class methodobject(object):
if hasattr(func, '
__doc__
'):
doc=func.__doc__
if not doc: doc=''
doc=
string.strip(doc
)
doc=
doc.strip(
)
if hasattr(func, '
func_code
'):
if hasattr(func.func_code, '
co_varnames
'):
return doc
...
...
@@ -268,14 +268,14 @@ class methodobject(object):
if method: args=args[1:]
if name=='
__call__
':
name='
Call
Operation
'
return '
%
s
(
%
s
)
' % (name,
string.join(args,'
,
'
))
return '
%
s
(
%
s
)
' % (name,
'
,
'.join(args
))
# Other functions - look for something that smells like
# a signature at the beginning of the docstring.
if hasattr(func, '
__doc__
'):
doc=func.__doc__
if not doc: doc=''
doc=
string.strip(doc
)
doc=
doc.strip(
)
mo=sig_match(doc)
if mo is not None:
return doc[:mo.end(0)]
...
...
lib/python/HelpSys/ObjectRef.py
View file @
cf2042ee
...
...
@@ -12,10 +12,10 @@
##############################################################################
"""Object Reference implementation"""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
Globals
,
Acquisition
import
sys
,
os
,
Globals
,
Acquisition
from
HelpUtil
import
HelpBase
,
classobject
from
HelpUtil
import
is_class
,
is_module
from
Globals
import
DTMLFile
...
...
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