Commits

Ronny Pfannschmidt  committed c008a08

integrate the changes from pida.utils.pyconsole to the debug console

  • Participants
  • Parent commits 8c6c734

Comments (0)

Files changed (1)

File pygtkhelpers/debug/console.py

         sys.stdout, sys.stderr = saved_stdout, saved_stderr
         self.raw_input(ps)
 
+    def execfile(self, filename):
+        saved_stdout, saved_stderr = sys.stdout, sys.stderr
+        sys.stdout, sys.stderr = self._stdout, self._stderr
+        try:
+            execfile(filename, self.locals)
+        except SystemExit:
+            raise
+        except:
+            self.showtraceback()
+        finally:
+            sys.stdout, sys.stderr = saved_stdout, saved_stderr
+
     def do_command(self, code):
         try:
             eval(code, self.locals)
         completions.sort()
         return completions
 
+    def flush(self):
+        pass
+
+    def tell(self):
+        return 0
+
+    def isatty(self):
+        return False
+
+    def truncate(self):
+        raise IOError('cant truncate fake file')
 
 def ReadLineType(t=gtk.TextView):
     class readline(t, _ReadLine):