Show More
@@ -516,9 +516,10 b' class IPShellWidget(wx.Panel):' | |||
|
516 | 516 | #---------------------- IPython Thread Management ------------------------ |
|
517 | 517 | def stateDoExecuteLine(self): |
|
518 | 518 | #print >>sys.__stdout__,"command:",self.getCurrentLine() |
|
519 | line=self.text_ctrl.getCurrentLine() | |
|
519 | lines=self.text_ctrl.getCurrentLine() | |
|
520 | 520 | self.text_ctrl.write('\n') |
|
521 | self.IP.doExecute((line.replace('\t',' '*4)).encode('cp1252')) | |
|
521 | for line in lines.split('\n'): | |
|
522 | self.IP.doExecute((line.replace('\t',' '*4)).encode('cp1252')) | |
|
522 | 523 | self.updateHistoryTracker(self.text_ctrl.getCurrentLine()) |
|
523 | 524 | self.setCurrentState('WAIT_END_OF_EXECUTION') |
|
524 | 525 | |
@@ -527,12 +528,12 b' class IPShellWidget(wx.Panel):' | |||
|
527 | 528 | self.help = self.IP.getHelpText() |
|
528 | 529 | if self.doc: |
|
529 | 530 | self.pager_lines = self.doc[7:].split('\n') |
|
530 |
|
|
|
531 | self.pager_state = 'INIT' | |
|
531 | 532 | self.setCurrentState('SHOW_DOC') |
|
532 | 533 | self.pager(self.doc) |
|
533 | 534 | elif self.help: |
|
534 | 535 | self.pager_lines = self.help.split('\n') |
|
535 |
|
|
|
536 | self.pager_state = 'INIT' | |
|
536 | 537 | self.setCurrentState('SHOW_DOC') |
|
537 | 538 | self.pager(self.help) |
|
538 | 539 | else: |
@@ -563,43 +564,43 b' class IPShellWidget(wx.Panel):' | |||
|
563 | 564 | def pager(self,text): |
|
564 | 565 | |
|
565 | 566 | if self.pager_state == 'INIT': |
|
566 |
|
|
|
567 | #print >>sys.__stdout__,"PAGER state:",self.pager_state | |
|
567 | 568 | self.pager_nb_lines = len(self.pager_lines) |
|
568 |
|
|
|
569 |
|
|
|
570 |
|
|
|
571 |
|
|
|
572 | ||
|
573 |
|
|
|
574 |
|
|
|
575 |
|
|
|
576 |
|
|
|
577 |
|
|
|
578 | ||
|
579 |
|
|
|
580 |
|
|
|
581 |
|
|
|
582 |
|
|
|
583 | else: | |
|
584 |
|
|
|
585 | ||
|
586 |
|
|
|
587 |
|
|
|
588 |
|
|
|
589 |
|
|
|
590 |
|
|
|
591 |
|
|
|
592 |
|
|
|
593 | return | |
|
594 |
|
|
|
595 |
|
|
|
596 |
|
|
|
597 | if self.pager_index > 0: | |
|
598 |
|
|
|
599 | else: | |
|
600 |
|
|
|
601 | ||
|
602 | self.pager_index += 1 | |
|
569 | self.pager_index = 0 | |
|
570 | self.pager_do_remove = False | |
|
571 | self.text_ctrl.write('\n') | |
|
572 | self.pager_state = 'PROCESS_LINES' | |
|
573 | ||
|
574 | if self.pager_state == 'PROCESS_LINES': | |
|
575 | #print >>sys.__stdout__,"PAGER state:",self.pager_state | |
|
576 | if self.pager_do_remove == True: | |
|
577 | self.text_ctrl.removeCurrentLine() | |
|
578 | self.pager_do_remove = False | |
|
579 | ||
|
580 | if self.pager_nb_lines > 10: | |
|
581 | #print >>sys.__stdout__,"PAGER processing 10 lines" | |
|
582 | if self.pager_index > 0: | |
|
583 | self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n') | |
|
584 | else: | |
|
585 | self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n') | |
|
586 | ||
|
587 | for line in self.pager_lines[self.pager_index+1:self.pager_index+9]: | |
|
588 | self.text_ctrl.write("\x01\x1b[1;36m\x02 "+line+'\n') | |
|
589 | self.pager_index += 10 | |
|
590 | self.pager_nb_lines -= 10 | |
|
591 | self.text_ctrl.write("--- Push Enter to continue or 'Q' to quit---") | |
|
592 | self.pager_do_remove = True | |
|
593 | self.pager_state = 'WAITING' | |
|
594 | return | |
|
595 | else: | |
|
596 | #print >>sys.__stdout__,"PAGER processing last lines" | |
|
597 | if self.pager_nb_lines > 0: | |
|
598 | if self.pager_index > 0: | |
|
599 | self.text_ctrl.write(">\x01\x1b[1;36m\x02"+self.pager_lines[self.pager_index]+'\n') | |
|
600 | else: | |
|
601 | self.text_ctrl.write("\x01\x1b[1;36m\x02 "+self.pager_lines[self.pager_index]+'\n') | |
|
602 | ||
|
603 | self.pager_index += 1 | |
|
603 | 604 | self.pager_nb_lines -= 1 |
|
604 | 605 | if self.pager_nb_lines > 0: |
|
605 | 606 | for line in self.pager_lines[self.pager_index:]: |
@@ -642,6 +643,7 b' class IPShellWidget(wx.Panel):' | |||
|
642 | 643 | if event.GetKeyCode() in [ord('q'),ord('Q')]: |
|
643 | 644 | if self.pager_state == 'WAITING': |
|
644 | 645 | self.pager_state = 'DONE' |
|
646 | self.text_ctrl.write('\n') | |
|
645 | 647 | self.stateShowPrompt() |
|
646 | 648 | return |
|
647 | 649 |
General Comments 0
You need to be logged in to leave comments.
Login now