Lines Matching defs:text

2 """Generate Python documentation in HTML or text for interactive use.
213 def replace(text, *pairs):
216 text = pairs[1].join(text.split(pairs[0]))
218 return text
220 def cram(text, maxlen):
222 if len(text) > maxlen:
225 return text[:pre] + '...' + text[len(text)-post:]
226 return text
229 def stripid(text):
232 return _re_stripid.sub(r'\1', text)
370 # text modules can be directly examined
531 def escape(self, text):
532 return replace(text, '&', '&amp;', '<', '&lt;', '>', '&gt;')
590 <tr class="heading-text decor">
602 <tr class="decor %s-decor heading-text">
621 def preformat(self, text):
622 """Format literal preformatted text."""
623 text = self.escape(text.expandtabs())
624 return replace(text, '\n\n', '\n \n', '\n\n', '\n \n',
639 def grey(self, text): return '<span class="grey">%s</span>' % text
670 text = '<strong>%s</strong>&nbsp;(package)' % name
672 text = name
673 return '<a href="%s">%s</a>' % (url, text)
679 def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
680 """Mark up some plain text, given a context of symbols to look for.
690 match = pattern.search(text, here)
693 results.append(escape(text[here:start]))
708 if text[end:end+1] == '(':
712 elif text[end:end+1] == '(':
717 results.append(escape(text[here:]))
728 result = result + '<dt class="heading-text">'
1021 """Format an argument default value as text."""
1079 self.grey('<span class="heading-text">%s</span>' % note))
1125 # -------------------------------------------- text documentation generator
1128 """Class for safely making a text representation of a Python object."""
1160 """Formatter class for text documentation."""
1162 # ------------------------------------------- text formatting utilities
1167 def bold(self, text):
1169 return ''.join(ch + '\b' + ch for ch in text)
1171 def indent(self, text, prefix=' '):
1172 """Indent text by prepending a given prefix to each line."""
1173 if not text: return ''
1174 lines = [prefix + line for line in text.split('\n')]
1186 """Render in text a class tree as returned by inspect.getclasstree()."""
1202 """Produce text documentation for a given module object."""
1303 """Produce text documentation for a given class object."""
1457 """Format an argument default value as text."""
1461 """Produce text documentation for a function or method object."""
1516 """Produce text documentation for a data descriptor."""
1532 """Produce text documentation for a data object."""
1547 def bold(self, text):
1548 return text
1552 def pager(text):
1556 pager(text)
1559 """Decide what method to use for paging through text."""
1571 return lambda text: tempfilepager(plain(text), use_pager)
1573 return lambda text: pipepager(plain(text), use_pager)
1575 return lambda text: pipepager(text, use_pager)
1579 return lambda text: tempfilepager(plain(text), 'more <')
1581 return lambda text: pipepager(text, 'less')
1588 return lambda text: pipepager(text, 'more')
1594 def plain(text):
1595 """Remove boldface formatting from text."""
1596 return re.sub('.\b', '', text)
1598 def pipepager(text, cmd):
1599 """Page through text by feeding it to another program."""
1606 pipe.write(text)
1608 # We've hereby abandoned whatever text hasn't been written,
1622 def tempfilepager(text, cmd):
1623 """Page through text by invoking a program on a temporary file."""
1631 file.write(text)
1634 def _escape_stdout(text):
1637 return text.encode(encoding, 'backslashreplace').decode(encoding)
1639 def ttypager(text):
1640 """Page through text on a text terminal."""
1641 lines = plain(_escape_stdout(text)).split('\n')
1683 def plainpager(text):
1684 """Simply print unformatted text. This is the ultimate fallback."""
1685 sys.stdout.write(plain(_escape_stdout(text)))
1735 text = TextDoc()
1755 """Render text documentation, given an object or a path to an object."""
1757 renderer = text
1782 """Display text documentation, given an object or a path to an object."""
2145 text = 'Related help topics: ' + ', '.join(xrefs.split()) + '\n'
2146 wrapped_text = textwrap.wrap(text, 72)
2290 Start an HTML/text server thread, so HTML or text documents can be
2299 Then get or generate some text or HTML code and return it.
2302 ... text = 'the URL sent was: (%s, %s)' % (url, content_type)
2303 ... return text
2357 content_type = 'text/css'
2359 content_type = 'text/html'
2439 def _url_handler(url, content_type="text/html"):
2442 If the content_type is 'text/css', the _pydoc.css style
2445 If the content_type is 'text/html', then the result of
2454 '<link rel="stylesheet" type="text/css" href="%s">' %
2477 <div style='text-align:center'>
2484 <input type=text name=key size=15>
2488 <input type=text name=key size=15>
2515 '<p align=right class="heading-text grey"><strong>pydoc</strong> by Ka-Ping Yee'
2664 if content_type == 'text/css':
2669 elif content_type == 'text/html':
2811 Show text documentation on something. <name> may be the name of a