Lines Matching refs:filename
26 def getline(filename, lineno, module_globals=None): argument
30 lines = getlines(filename, module_globals)
36 def getlines(filename, module_globals=None): argument
40 if filename in cache:
41 entry = cache[filename]
43 return cache[filename][2]
46 return updatecache(filename, module_globals)
52 def checkcache(filename=None): argument
56 if filename is None:
58 elif filename in cache:
59 filenames = [filename]
63 for filename in filenames:
64 entry = cache[filename]
74 cache.pop(filename, None)
77 cache.pop(filename, None)
80 def updatecache(filename, module_globals=None): argument
85 if filename in cache:
86 if len(cache[filename]) != 1:
87 cache.pop(filename, None)
88 if not filename or (filename.startswith('<') and filename.endswith('>')):
91 fullname = filename
95 basename = filename
99 if lazycache(filename, module_globals):
101 data = cache[filename][0]()
109 cache[filename] = (
115 return cache[filename][2]
119 if os.path.isabs(filename):
143 cache[filename] = size, mtime, lines, fullname
147 def lazycache(filename, module_globals): argument
160 if filename in cache:
161 if len(cache[filename]) == 1:
165 if not filename or (filename.startswith('<') and filename.endswith('>')):
175 cache[filename] = (get_lines,)