Mercurial > vim
comparison src/testdir/test86.in @ 4511:ce94a870b59b v7.3.1003
updated for version 7.3.1003
Problem: Python interface does not compile with Python 2.2
Solution: Fix thread issues and True/False. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 May 2013 22:23:56 +0200 |
parents | ef02f32d8e53 |
children | fa39483a1363 |
comparison
equal
deleted
inserted
replaced
4510:c5406fa95658 | 4511:ce94a870b59b |
---|---|
516 :edit b | 516 :edit b |
517 :buffer # | 517 :buffer # |
518 :edit c | 518 :edit c |
519 :buffer # | 519 :buffer # |
520 py << EOF | 520 py << EOF |
521 try: | |
522 from __builtin__ import next | |
523 except ImportError: | |
524 next = lambda o: o.next() | |
521 # Check GCing iterator that was not fully exhausted | 525 # Check GCing iterator that was not fully exhausted |
522 i = iter(vim.buffers) | 526 i = iter(vim.buffers) |
523 cb.append('i:' + str(next(i))) | 527 cb.append('i:' + str(next(i))) |
524 # and also check creating more then one iterator at a time | 528 # and also check creating more then one iterator at a time |
525 i2 = iter(vim.buffers) | 529 i2 = iter(vim.buffers) |
575 :vnew c.2 | 579 :vnew c.2 |
576 py << EOF | 580 py << EOF |
577 cb.append('Number of tabs: ' + str(len(vim.tabpages))) | 581 cb.append('Number of tabs: ' + str(len(vim.tabpages))) |
578 cb.append('Current tab pages:') | 582 cb.append('Current tab pages:') |
579 def W(w): | 583 def W(w): |
580 if '(unknown)' in repr(w): | 584 if repr(w).find('(unknown)') != -1: |
581 return '<window object (unknown)>' | 585 return '<window object (unknown)>' |
582 else: | 586 else: |
583 return repr(w) | 587 return repr(w) |
588 | |
589 def Cursor(w, start=len(cb)): | |
590 if w.buffer is cb: | |
591 return repr((start - w.cursor[0], w.cursor[1])) | |
592 else: | |
593 return repr(w.cursor) | |
594 | |
584 for t in vim.tabpages: | 595 for t in vim.tabpages: |
585 cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) | 596 cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) |
586 cb.append(' Windows:') | 597 cb.append(' Windows:') |
587 for w in t.windows: | 598 for w in t.windows: |
588 cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor)) | 599 cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w)) |
589 # Other values depend on the size of the terminal, so they are checked partly: | 600 # Other values depend on the size of the terminal, so they are checked partly: |
590 for attr in ('height', 'row', 'width', 'col'): | 601 for attr in ('height', 'row', 'width', 'col'): |
591 try: | 602 try: |
592 aval = getattr(w, attr) | 603 aval = getattr(w, attr) |
593 if type(aval) is not long: | 604 if type(aval) is not long: |