##// END OF EJS Templates
Simplify line info code.
Fernando Perez -
Show More
@@ -118,8 +118,6 b' class LineInfo(object):'
118 else:
118 else:
119 self.pre_whitespace = self.pre
119 self.pre_whitespace = self.pre
120
120
121 self._oinfo = None
122
123 def ofind(self, ip):
121 def ofind(self, ip):
124 """Do a full, attribute-walking lookup of the ifun in the various
122 """Do a full, attribute-walking lookup of the ifun in the various
125 namespaces for the given IPython InteractiveShell instance.
123 namespaces for the given IPython InteractiveShell instance.
@@ -133,10 +131,7 b' class LineInfo(object):'
133 Does cache the results of the call, so can be called multiple times
131 Does cache the results of the call, so can be called multiple times
134 without worrying about *further* damaging state.
132 without worrying about *further* damaging state.
135 """
133 """
136 if not self._oinfo:
134 return ip._ofind(self.ifun)
137 # ip.shell._ofind is actually on the Magic class!
138 self._oinfo = ip._ofind(self.ifun)
139 return self._oinfo
140
135
141 def __str__(self):
136 def __str__(self):
142 return "LineInfo [%s|%s|%s|%s]" %(self.pre, self.esc, self.ifun, self.the_rest)
137 return "LineInfo [%s|%s|%s|%s]" %(self.pre, self.esc, self.ifun, self.the_rest)
General Comments 0
You need to be logged in to leave comments. Login now