| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 301a354 commit ee2ab57
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -444,7 +444,7 @@ def clear_wrapped_lines(self): | |||
| 444 | 444 | # curses does not handle this on its own. Sad. | |
| 445 | 445 | height, width = self.scr.getmaxyx() | |
| 446 | 446 | max_y = min(self.iy + (self.ix + len(self.s)) // width + 1, height) | |
| 447 | - for y in xrange(self.iy + 1, max_y): | ||
| 447 | + for y in range(self.iy + 1, max_y): | ||
| 448 | 448 | self.scr.move(y, 0) | |
| 449 | 449 | self.scr.clrtoeol() | |
| 450 | 450 | ||
@@ -660,7 +660,7 @@ def get_line(self): | |||
| 660 | 660 | self.iy, self.ix = self.scr.getyx() | |
| 661 | 661 | ||
| 662 | 662 | if not self.paste_mode: | |
| 663 | - for _ in xrange(self.next_indentation()): | ||
| 663 | + for _ in range(self.next_indentation()): | ||
| 664 | 664 | self.p_key('\t') | |
| 665 | 665 | ||
| 666 | 666 | self.cpos = 0 | |
@@ -1156,7 +1156,7 @@ def reprint_line(self, lineno, tokens): | |||
| 1156 | 1156 | ||
| 1157 | 1157 | real_lineno = self.iy | |
| 1158 | 1158 | height, width = self.scr.getmaxyx() | |
| 1159 | - for i in xrange(lineno, len(self.buffer)): | ||
| 1159 | + for i in range(lineno, len(self.buffer)): | ||
| 1160 | 1160 | string = self.buffer[i] | |
| 1161 | 1161 | # 4 = length of prompt | |
| 1162 | 1162 | length = len(string.encode(getpreferredencoding())) + 4 | |
@@ -1223,7 +1223,7 @@ def reevaluate(self): | |||
| 1223 | 1223 | self.scr.refresh() | |
| 1224 | 1224 | ||
| 1225 | 1225 | if self.buffer: | |
| 1226 | - for _ in xrange(indent): | ||
| 1226 | + for _ in range(indent): | ||
| 1227 | 1227 | self.tab() | |
| 1228 | 1228 | ||
| 1229 | 1229 | self.evaluating = False | |
@@ -1517,7 +1517,7 @@ def send_current_line_to_editor(self): | |||
| 1517 | 1517 | self.scr.refresh() | |
| 1518 | 1518 | ||
| 1519 | 1519 | if self.buffer: | |
| 1520 | - for _ in xrange(indent): | ||
| 1520 | + for _ in range(indent): | ||
| 1521 | 1521 | self.tab() | |
| 1522 | 1522 | ||
| 1523 | 1523 | self.print_line(self.s) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,7 +127,7 @@ def forward(self, start=True, search=False, target=None, | |||
| 127 | 127 | def find_match_forward(self, search_term, include_current=False): | |
| 128 | 128 | add = 0 if include_current else 1 | |
| 129 | 129 | end = max(0, self.index - (1 - add)) | |
| 130 | - for idx in xrange(end): | ||
| 130 | + for idx in range(end): | ||
| 131 | 131 | val = self.entries_by_index[end - 1 - idx] | |
| 132 | 132 | if val.startswith(search_term): | |
| 133 | 133 | return idx + (0 if include_current else 1) | |
@@ -136,7 +136,7 @@ def find_match_forward(self, search_term, include_current=False): | |||
| 136 | 136 | def find_partial_match_forward(self, search_term, include_current=False): | |
| 137 | 137 | add = 0 if include_current else 1 | |
| 138 | 138 | end = max(0, self.index - (1 - add)) | |
| 139 | - for idx in xrange(end): | ||
| 139 | + for idx in range(end): | ||
| 140 | 140 | val = self.entries_by_index[end - 1 - idx] | |
| 141 | 141 | if search_term in val: | |
| 142 | 142 | return idx + add | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,8 +66,8 @@ def __setitem__(self, key, value): | |||
| 66 | 66 | cli_key_dispatch['C-_'] = (chr(31), '^_') | |
| 67 | 67 | ||
| 68 | 68 | # fill dispatch with function keys | |
| 69 | - for x in xrange(1, 13): | ||
| 69 | + for x in range(1, 13): | ||
| 70 | 70 | cli_key_dispatch['F%s' % str(x)] = ('KEY_F(%s)' % str(x),) | |
| 71 | 71 | ||
| 72 | - for x in xrange(1, 13): | ||
| 72 | + for x in range(1, 13): | ||
| 73 | 73 | urwid_key_dispatch['F%s' % str(x)] = 'f%s' % str(x) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ def run_bpython(self, input): | |||
| 53 | 53 | result = Deferred() | |
| 54 | 54 | ||
| 55 | 55 | class Protocol(ProcessProtocol): | |
| 56 | - STATES = (SEND_INPUT, COLLECT) = xrange(2) | ||
| 56 | + STATES = (SEND_INPUT, COLLECT) = range(2) | ||
| 57 | 57 | ||
| 58 | 58 | def __init__(self): | |
| 59 | 59 | self.data = "" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ def test_left_arrow_at_zero(self): | |||
| 25 | 25 | self.assertEquals(expected, result) | |
| 26 | 26 | ||
| 27 | 27 | def test_left_arrow_at_non_zero(self): | |
| 28 | - for i in xrange(1, len(self._line)): | ||
| 28 | + for i in range(1, len(self._line)): | ||
| 29 | 29 | expected = (i-1, self._line) | |
| 30 | 30 | result = left_arrow(i, self._line) | |
| 31 | 31 | self.assertEqual(expected, result) | |
@@ -37,20 +37,20 @@ def test_right_arrow_at_end(self): | |||
| 37 | 37 | self.assertEquals(expected, result) | |
| 38 | 38 | ||
| 39 | 39 | def test_right_arrow_at_non_end(self): | |
| 40 | - for i in xrange(len(self._line) - 1): | ||
| 40 | + for i in range(len(self._line) - 1): | ||
| 41 | 41 | expected = (i + 1, self._line) | |
| 42 | 42 | result = right_arrow(i, self._line) | |
| 43 | 43 | self.assertEquals(expected, result) | |
| 44 | 44 | ||
| 45 | 45 | def test_beginning_of_line(self): | |
| 46 | 46 | expected = (0, self._line) | |
| 47 | - for i in xrange(len(self._line)): | ||
| 47 | + for i in range(len(self._line)): | ||
| 48 | 48 | result = beginning_of_line(i, self._line) | |
| 49 | 49 | self.assertEquals(expected, result) | |
| 50 | 50 | ||
| 51 | 51 | def test_end_of_line(self): | |
| 52 | 52 | expected = (len(self._line), self._line) | |
| 53 | - for i in xrange(len(self._line)): | ||
| 53 | + for i in range(len(self._line)): | ||
| 54 | 54 | result = end_of_line(i, self._line) | |
| 55 | 55 | self.assertEquals(expected, result) | |
| 56 | 56 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -893,7 +893,7 @@ def reevaluate(self): | |||
| 893 | 893 | self.scr.refresh() | |
| 894 | 894 | ||
| 895 | 895 | if self.buffer: | |
| 896 | - for unused in xrange(indent): | ||
| 896 | + for unused in range(indent): | ||
| 897 | 897 | self.tab() | |
| 898 | 898 | ||
| 899 | 899 | self.evaluating = False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments