MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / source_synopsis

Function source_synopsis

tools/python-3.11.9-amd64/Lib/pydoc.py:348–363  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

346 return False
347
348def source_synopsis(file):
349 line = file.readline()
350 while line[:1] == '#' or not line.strip():
351 line = file.readline()
352 if not line: break
353 line = line.strip()
354 if line[:4] == 'r"""': line = line[1:]
355 if line[:3] == '"""':
356 line = line[3:]
357 if line[-1:] == '\\': line = line[:-1]
358 while not line.strip():
359 line = file.readline()
360 if not line: break
361 result = line.split('"""')[0].strip()
362 else: result = None
363 return result
364
365def synopsis(filename, cache={}):
366 """Get the one-line summary out of a module file."""

Callers 2

synopsisFunction · 0.85
runMethod · 0.85

Calls 3

stripMethod · 0.80
readlineMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected