~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to services/python-console

  • Committer: William Grant
  • Date: 2009-03-26 05:33:03 UTC
  • mto: (1165.3.1 submissions)
  • mto: This revision was merged to the branch mainline in revision 1174.
  • Revision ID: grantw@unimelb.edu.au-20090326053303-t1wsjswhk2sl2gml
Start a submission UI in ivle.webapp.submit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
 
209
209
        # Try to execute the buffer
210
210
        try:
211
 
            cmd = self.cc(self.curr_cmd, '<web session>')
 
211
            # A single trailing newline simply indicates that the line is
 
212
            # finished. Two trailing newlines indicate the end of a block.
 
213
            # Unfortunately, codeop.CommandCompiler causes even one to
 
214
            # terminate a block.
 
215
            # Thus we need to remove a trailing newline from the command,
 
216
            # unless there are *two* trailing newlines, or multi-line indented
 
217
            # blocks are impossible. See Google Code issue 105.
 
218
            cmd_text = self.curr_cmd
 
219
            if cmd_text.endswith('\n') and not cmd_text.endswith('\n\n'):
 
220
                cmd_text = cmd_text[:-1]
 
221
            cmd = self.cc(cmd_text, '<web session>')
212
222
            if cmd is None:
213
223
                # The command was incomplete, so send back a None, so the              
214
224
                # client can print a '...'