Get a line for a Python source file from the cache. Update the cache if it doesn't contain an entry for this file already.
(filename, lineno, module_globals=None)
| 20 | |
| 21 | |
| 22 | def getline(filename, lineno, module_globals=None): |
| 23 | """Get a line for a Python source file from the cache. |
| 24 | Update the cache if it doesn't contain an entry for this file already.""" |
| 25 | |
| 26 | lines = getlines(filename, module_globals) |
| 27 | if 1 <= lineno <= len(lines): |
| 28 | return lines[lineno - 1] |
| 29 | return '' |
| 30 | |
| 31 | |
| 32 | def getlines(filename, module_globals=None): |
searching dependent graphs…