1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import pydoc
24 import sys
25
26
27
28
29
30 relax_class_help = """
31 This is a python class which contains user functions. To list these functions, either place a
32 period at the end of class name and hit the tab key, or type 'dir(class_name)'.
33 """
34
35
36
37
38
40 text = """\
41 For assistance in using a function, simply type 'help(function)'. All functions can be viewed by
42 hitting the [TAB] key. In addition to functions, if 'help(object)' is typed, the help for the
43 python object is returned. This system is similar to the help function built into the python
44 interpreter, which has been renamed to help_python, with the interactive component removed. For the
45 interactive python help system, type 'help_python()'.
46 """
47
50
52 if len(args) != 1 or type(args[0]) == str:
53 print self.text
54 return
55 if hasattr(args[0], '__relax_help__'):
56 sys.stdout.write(args[0].__relax_help__ + "\n")
57 return
58 return pydoc.help(*args, **kwds)
59
60
62 text = """\
63 For the interactive python help system, type 'help_python()'. The help_python function is identical
64 to the help function built into the normal python interpreter.
65 """
66
69
71 return pydoc.help(*args, **kwds)
72