Fix contiuation in interpreter.
Fix contiuation in interpreter.


Index: trunk/examples/interpreter.py
===================================================================
--- trunk/examples/interpreter.py	(revision 503)
+++ trunk/examples/interpreter.py	(working copy)
@@ -58,6 +58,7 @@
         self.element = element
         self.buffer = ''
         self.stream = DOMInterpreter.Stream(self)
+        self.source = []

         self.write('pyglet interpreter\n')
         self.write('>>> ')
@@ -66,7 +67,6 @@
         self.element.add_text(data)

     def input(self, input):
-        print 'BEFORE', (self.element.text, )
         _stdout = sys.stdout
         sys.stdout = self.stream

@@ -74,17 +74,16 @@
         self.buffer += input
         if '\n' in self.buffer:
             source, self.buffer = self.buffer.rsplit('\n', 1)
-            print >> _stdout, ('run', source, self.buffer)
-            prompt = self.runsource(source)
-            print >> _stdout, ('...', prompt)
+            self.source.append(source)
+            prompt = self.runsource('\n'.join(self.source))

             if prompt:
                 self.write('... ')
             else:
+                self.source = []
                 self.write('>>> ')

         sys.stdout = _stdout
-        print 'AFTER', (self.element.text, )

     def backspace(self):
         self.buffer = self.buffer[:-1]

--HG--
extra : convert_revision : svn%3A14d46d22-621c-0410-bb3d-6f67920f7d95/trunk%40504

infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore