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
872a59c9
Commit
872a59c9
authored
Dec 03, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructuring to avoid name-hiding problems
parent
5ca75ac9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
172 additions
and
120 deletions
+172
-120
lib/python/HelpSys/HelpSys.py
lib/python/HelpSys/HelpSys.py
+24
-109
lib/python/HelpSys/HelpUtil.py
lib/python/HelpSys/HelpUtil.py
+16
-2
lib/python/HelpSys/ObjectRef.py
lib/python/HelpSys/ObjectRef.py
+123
-0
lib/python/HelpSys/helpsys.dtml
lib/python/HelpSys/helpsys.dtml
+1
-1
lib/python/HelpSys/images/hs_cbook.gif
lib/python/HelpSys/images/hs_cbook.gif
+0
-0
lib/python/HelpSys/images/hs_darrow.gif
lib/python/HelpSys/images/hs_darrow.gif
+0
-0
lib/python/HelpSys/images/hs_dnode.gif
lib/python/HelpSys/images/hs_dnode.gif
+0
-0
lib/python/HelpSys/images/hs_larrow.gif
lib/python/HelpSys/images/hs_larrow.gif
+0
-0
lib/python/HelpSys/images/hs_obook.gif
lib/python/HelpSys/images/hs_obook.gif
+0
-0
lib/python/HelpSys/images/hs_rarrow.gif
lib/python/HelpSys/images/hs_rarrow.gif
+0
-0
lib/python/HelpSys/images/hs_uarrow.gif
lib/python/HelpSys/images/hs_uarrow.gif
+0
-0
lib/python/HelpSys/objectitem.dtml
lib/python/HelpSys/objectitem.dtml
+4
-4
lib/python/HelpSys/objectref.dtml
lib/python/HelpSys/objectref.dtml
+4
-4
No files found.
lib/python/HelpSys/HelpSys.py
View file @
872a59c9
"""Help system
and documentation support
"""
"""Help system
implementation
"""
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
ts_regex
import
Globals
,
Acquisition
,
StructuredText
from
HelpUtil
import
classobject
,
is_class
,
is_module
import
sys
,
os
,
string
,
Globals
,
Acquisition
from
HelpUtil
import
HelpBase
from
ObjectRef
import
ObjectRef
from
ImageFile
import
ImageFile
from
Globals
import
HTMLFile
...
...
@@ -13,118 +13,33 @@ from Globals import HTMLFile
class
ObjectItem
(
classobject
):
"""Object type wrapper"""
index_html
=
HTMLFile
(
'objectitem_index'
,
globals
())
__roles__
=
None
def
__getattr__
(
self
,
name
):
if
name
in
(
'isDocTemp'
,
'__call__'
):
raise
AttributeError
,
name
return
getattr
(
self
.
__dict__
[
'_obj_'
],
name
)
def
get_method_list
(
self
):
rdict
=
classobject
.
get_method_dict
(
self
)
perms
=
self
.
__ac_permissions__
mdict
=
{}
mlist
=
[]
for
p
in
self
.
__ac_permissions__
:
pname
=
p
[
0
]
fnames
=
p
[
1
]
for
fname
in
fnames
:
if
rdict
.
has_key
(
fname
):
fn
=
rdict
[
fname
]
fn
.
permission
=
pname
mdict
[
fname
]
=
fn
keys
=
mdict
.
keys
()
keys
.
sort
()
for
key
in
keys
:
fn
=
mdict
[
key
]
if
not
hasattr
(
fn
.
_obj_
,
'__doc__'
):
continue
doc
=
fn
.
_obj_
.
__doc__
if
hasattr
(
fn
.
_obj_
,
'__class__'
)
and
\
fn
.
_obj_
.
__class__
.
__doc__
is
doc
:
continue
mlist
.
append
(
mdict
[
key
])
del
rdict
del
mdict
return
mlist
class
ObjectRef
(
Acquisition
.
Implicit
):
"""Object reference"""
class
HelpSys
(
HelpBase
):
""" """
__names__
=
None
__roles__
=
None
index_html
=
HTMLFile
(
'objectref_index'
,
globals
())
def
deferred__init__
(
self
):
# This is necessary because we want to wait until all
# products have been installed (imported).
dict
=
{}
for
k
,
v
in
sys
.
modules
.
items
():
if
v
is
not
None
and
k
!=
'__builtins__'
:
dict
=
self
.
search_mod
(
v
,
dict
)
keys
=
dict
.
keys
()
keys
.
sort
()
for
key
in
keys
:
setattr
(
self
,
key
,
dict
[
key
])
self
.
__names__
=
keys
objectValues__roles__
=
None
def
objectValues
(
self
):
if
self
.
__names__
is
None
:
self
.
deferred__init__
()
items
=
[]
for
id
in
self
.
__names__
:
items
.
append
(
getattr
(
self
,
id
))
return
items
def
search_mod
(
self
,
mod
,
dict
):
hidden
=
(
'Control Panel'
,
'Principia Draft'
,
'simple item'
)
for
k
,
v
in
mod
.
__dict__
.
items
():
if
is_class
(
v
)
and
hasattr
(
v
,
'meta_type'
)
and
\
hasattr
(
v
,
'__ac_permissions__'
)
and
\
(
v
.
meta_type
not
in
hidden
):
dict
[
v
.
meta_type
]
=
ObjectItem
(
k
,
v
)
if
is_module
(
v
)
and
hasattr
(
v
,
'__path__'
):
dict
=
self
.
search_mod
(
v
,
dict
)
return
dict
def
__getitem__
(
self
,
key
):
return
self
.
__dict__
[
key
].
__of__
(
self
)
def
tpId
(
self
):
return
'ObjectRef'
tpURL
=
tpId
def
tpValues
(
self
):
return
self
.
objectValues
()
def
__len__
(
self
):
return
1
hs_index
=
HTMLFile
(
'helpsys'
,
globals
())
class
HelpSys
(
Acquisition
.
Implicit
):
"""Help system root"""
__roles__
=
None
hs_cicon
=
'HelpSys/hs_cbook'
hs_eicon
=
'HelpSys/hs_obook'
index_html
=
HTMLFile
(
'helpsys_index'
,
globals
())
u_arrow
=
ImageFile
(
'u_arrow.gif'
,
globals
())
d_arrow
=
ImageFile
(
'd_arrow.gif'
,
globals
())
r_arrow
=
ImageFile
(
'r_arrow.gif'
,
globals
())
l_arrow
=
ImageFile
(
'l_arrow.gif'
,
globals
())
# Images used by the help system
hs_uarrow
=
ImageFile
(
'images/hs_uarrow.gif'
,
globals
())
hs_darrow
=
ImageFile
(
'images/hs_darrow.gif'
,
globals
())
hs_rarrow
=
ImageFile
(
'images/hs_rarrow.gif'
,
globals
())
hs_larrow
=
ImageFile
(
'images/hs_larrow.gif'
,
globals
())
hs_dnode
=
ImageFile
(
'images/hs_dnode.gif'
,
globals
())
hs_obook
=
ImageFile
(
'images/hs_obook.gif'
,
globals
())
hs_cbook
=
ImageFile
(
'images/hs_cbook.gif'
,
globals
())
hs_id
=
'HelpSys'
hs_title
=
'Help System'
ObjectRef
=
ObjectRef
()
hs_objectvalues__roles__
=
None
def
hs_objectvalues
(
self
):
return
[
self
.
ObjectRef
]
def
__len__
(
self
):
return
1
...
...
lib/python/HelpSys/HelpUtil.py
View file @
872a59c9
"""Help system
and documentation support
"""
"""Help system
support module
"""
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
Globals
,
Acquisition
...
...
@@ -11,6 +11,20 @@ import sys, os, string, ts_regex
stx_class
=
StructuredText
.
StructuredText
.
HTML
class
HelpBase
(
Acquisition
.
Implicit
):
""" """
def
__bobo_traverse__
(
self
,
REQUEST
,
name
=
None
):
# A sneaky trick - we cant really _have_ an index_html
# because that would often hide the index_html of a
# wrapped object ;(
if
name
==
'index_html'
:
return
self
.
hs_index
return
getattr
(
self
,
name
)
def
__len__
(
self
):
return
1
class
object
(
Acquisition
.
Implicit
):
def
__init__
(
self
,
name
,
ob
,
op
=
None
):
self
.
_name
=
name
...
...
lib/python/HelpSys/ObjectRef.py
0 → 100644
View file @
872a59c9
"""Object Reference implementation"""
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
import
sys
,
os
,
string
,
Globals
,
Acquisition
from
HelpUtil
import
HelpBase
,
classobject
from
HelpUtil
import
is_class
,
is_module
from
Globals
import
HTMLFile
from
urllib
import
quote
class
ObjectItem
(
HelpBase
,
classobject
):
""" """
__roles__
=
None
hs_index
=
HTMLFile
(
'objectitem'
,
globals
())
hs_cicon
=
'HelpSys/hs_dnode'
hs_eicon
=
'HelpSys/hs_dnode'
def
hs_id
(
self
):
return
self
.
_obj_
.
meta_type
def
hs_url
(
self
):
return
quote
(
self
.
_obj_
.
meta_type
)
hs_title
=
hs_id
def
__getattr__
(
self
,
name
):
if
name
in
(
'isDocTemp'
,
'__call__'
):
raise
AttributeError
,
name
return
getattr
(
self
.
__dict__
[
'_obj_'
],
name
)
def
get_method_list
(
self
):
rdict
=
classobject
.
get_method_dict
(
self
)
perms
=
self
.
__ac_permissions__
mdict
=
{}
mlist
=
[]
for
p
in
self
.
__ac_permissions__
:
pname
=
p
[
0
]
fnames
=
p
[
1
]
for
fname
in
fnames
:
if
rdict
.
has_key
(
fname
):
fn
=
rdict
[
fname
]
fn
.
permission
=
pname
mdict
[
fname
]
=
fn
keys
=
mdict
.
keys
()
keys
.
sort
()
for
key
in
keys
:
fn
=
mdict
[
key
]
if
not
hasattr
(
fn
.
_obj_
,
'__doc__'
):
continue
doc
=
fn
.
_obj_
.
__doc__
if
hasattr
(
fn
.
_obj_
,
'__class__'
)
and
\
fn
.
_obj_
.
__class__
.
__doc__
is
doc
:
continue
mlist
.
append
(
mdict
[
key
])
del
rdict
del
mdict
return
mlist
hs_objectvalues__roles__
=
None
def
hs_objectvalues
(
self
):
return
[]
class
ObjectRef
(
HelpBase
):
""" """
__names__
=
None
__roles__
=
None
hs_index
=
HTMLFile
(
'objectref'
,
globals
())
hs_cicon
=
'HelpSys/hs_cbook'
hs_eicon
=
'HelpSys/hs_obook'
hs_id
=
'ObjectRef'
hs_title
=
'Object Reference'
hs_url
=
hs_id
def
hs_deferred__init__
(
self
):
# This is necessary because we want to wait until all
# products have been installed (imported).
dict
=
{}
for
k
,
v
in
sys
.
modules
.
items
():
if
v
is
not
None
and
k
!=
'__builtins__'
:
dict
=
self
.
hs_search_mod
(
v
,
dict
)
keys
=
dict
.
keys
()
keys
.
sort
()
for
key
in
keys
:
setattr
(
self
,
key
,
dict
[
key
])
self
.
__names__
=
keys
def
hs_search_mod
(
self
,
mod
,
dict
):
# Root through a module for things that look like
# createable object classes.
hidden
=
(
'Control Panel'
,
'Principia Draft'
,
'simple item'
)
for
k
,
v
in
mod
.
__dict__
.
items
():
if
is_class
(
v
)
and
hasattr
(
v
,
'meta_type'
)
and
\
hasattr
(
v
,
'__ac_permissions__'
)
and
\
(
v
.
meta_type
not
in
hidden
):
dict
[
v
.
meta_type
]
=
ObjectItem
(
k
,
v
)
if
is_module
(
v
)
and
hasattr
(
v
,
'__path__'
):
dict
=
self
.
hs_search_mod
(
v
,
dict
)
return
dict
hs_objectvalues__roles__
=
None
def
hs_objectvalues
(
self
):
if
self
.
__names__
is
None
:
self
.
hs_deferred__init__
()
items
=
[]
for
id
in
self
.
__names__
:
items
.
append
(
getattr
(
self
,
id
))
return
items
def
__getitem__
(
self
,
key
):
return
self
.
__dict__
[
key
].
__of__
(
self
)
lib/python/HelpSys/helpsys
_index
.dtml
→
lib/python/HelpSys/helpsys.dtml
View file @
872a59c9
...
...
@@ -29,7 +29,7 @@ services provided by high-level objects such as Documents
and Folders. Other references will be added soon.
</p>
<ul>
<li>
<a
href=
"<!--#var BASE1-->/HelpSys/ObjectRef/
index_html
"
>
<li>
<a
href=
"<!--#var BASE1-->/HelpSys/ObjectRef/
hs_index
"
>
Object Reference
</a>
...
...
lib/python/HelpSys/images/hs_cbook.gif
0 → 100755
View file @
872a59c9
900 Bytes
lib/python/HelpSys/
d_
arrow.gif
→
lib/python/HelpSys/
images/hs_d
arrow.gif
View file @
872a59c9
File moved
lib/python/HelpSys/images/hs_dnode.gif
0 → 100755
View file @
872a59c9
900 Bytes
lib/python/HelpSys/
l_
arrow.gif
→
lib/python/HelpSys/
images/hs_l
arrow.gif
View file @
872a59c9
File moved
lib/python/HelpSys/images/hs_obook.gif
0 → 100755
View file @
872a59c9
916 Bytes
lib/python/HelpSys/
r_
arrow.gif
→
lib/python/HelpSys/
images/hs_r
arrow.gif
View file @
872a59c9
File moved
lib/python/HelpSys/
u_
arrow.gif
→
lib/python/HelpSys/
images/hs_u
arrow.gif
View file @
872a59c9
File moved
lib/python/HelpSys/objectitem
_index
.dtml
→
lib/python/HelpSys/objectitem.dtml
View file @
872a59c9
...
...
@@ -8,7 +8,7 @@ Object Reference
<a
name=
"top"
>
<h2><a
href=
"../
index_html
"
>
Object Reference
</a></h2>
<h2><a
href=
"../
hs_index
"
>
Object Reference
</a></h2>
...
...
@@ -64,15 +64,15 @@ Object Reference
<!--#else-->
<p>
No documentation for this method
</p>
<!--#endif-->
<a
href=
"#top"
><img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
u_
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
top
</a><br><br>
<a
href=
"#top"
><img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
hs_u
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
top
</a><br><br>
</code>
</dd>
<!--#endin-->
</dl>
<p>
<a
href=
"../
index_html
"
>
<img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
l_
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
Back to Object Reference
</a>
<a
href=
"../
hs_index
"
>
<img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
hs_l
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
Back to Object Reference
</a>
</p>
</body>
</html>
lib/python/HelpSys/objectref
_index
.dtml
→
lib/python/HelpSys/objectref.dtml
View file @
872a59c9
...
...
@@ -17,18 +17,18 @@ focuses on those object services useful in
<ul>
<!--#in
objectV
alues-->
<!--#in
hs_objectv
alues-->
<!--#with sequence-item-->
<li>
<a
href=
"<!--#var BASE1-->/HelpSys/ObjectRef/<!--#var
meta_type fmt=url-quote-->/
index_html
"
>
<!--#var meta_type-->
</a>
meta_type fmt=url-quote-->/
hs_index
"
>
<!--#var meta_type-->
</a>
<!--#endwith-->
</li>
<!--#endin-->
</ul>
<p>
<a
href=
"../
index_html
"
>
<img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
l_
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
Back to Help
</a>
<a
href=
"../
hs_index
"
>
<img
src=
"<!--#var SCRIPT_NAME-->/HelpSys/
hs_l
arrow"
height=
"9"
width=
"9"
border=
"0"
valign=
"bottom"
alt=
""
>
Back to Help
</a>
</p>
</body>
...
...
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