mirror of
https://github.com/python/cpython.git
synced 2025-10-13 18:33:34 +00:00
Merge PyIdle changes:
Rev 1.3 doerwalter (string methods)
This commit is contained in:
parent
06a0987fa8
commit
d1ec940ffc
1 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,3 @@
|
||||||
import string
|
|
||||||
import re
|
import re
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import tkMessageBox
|
import tkMessageBox
|
||||||
|
@ -175,7 +174,7 @@ class SearchEngine:
|
||||||
wrapped = 1
|
wrapped = 1
|
||||||
wrap = 0
|
wrap = 0
|
||||||
pos = text.index("end-1c")
|
pos = text.index("end-1c")
|
||||||
line, col = map(int, string.split(pos, "."))
|
line, col = map(int, pos.split("."))
|
||||||
chars = text.get("%d.0" % line, "%d.0" % (line+1))
|
chars = text.get("%d.0" % line, "%d.0" % (line+1))
|
||||||
col = len(chars) - 1
|
col = len(chars) - 1
|
||||||
return None
|
return None
|
||||||
|
@ -217,5 +216,5 @@ def get_selection(text):
|
||||||
# Helper to parse a text index into a (line, col) tuple.
|
# Helper to parse a text index into a (line, col) tuple.
|
||||||
|
|
||||||
def get_line_col(index):
|
def get_line_col(index):
|
||||||
line, col = map(int, string.split(index, ".")) # Fails on invalid index
|
line, col = map(int, index.split(".")) # Fails on invalid index
|
||||||
return line, col
|
return line, col
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue