summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE/PyDocSearch.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-02-21 13:54:31 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-02-21 13:54:31 (GMT)
commit9ad2752381b10cae83eb9e8044aa77dfd87d7039 (patch)
treee06b55db8ff39a445a6dcc83622fc229348d0582 /Mac/Tools/IDE/PyDocSearch.py
parent2d0589be6739e15bc27ab8996ee0727a5a3dda51 (diff)
downloadcpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.zip
cpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.tar.gz
cpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.tar.bz2
Use re in stead of regex, so we get rid of the annoying warning during startup.
Diffstat (limited to 'Mac/Tools/IDE/PyDocSearch.py')
-rw-r--r--Mac/Tools/IDE/PyDocSearch.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Mac/Tools/IDE/PyDocSearch.py b/Mac/Tools/IDE/PyDocSearch.py
index f975026..b036556 100644
--- a/Mac/Tools/IDE/PyDocSearch.py
+++ b/Mac/Tools/IDE/PyDocSearch.py
@@ -2,7 +2,7 @@ import aetools
import Standard_Suite
import Required_Suite
import WWW_Suite
-import regex
+import re
import W
import macfs
import os
@@ -29,16 +29,16 @@ app = W.getapplication()
#SIGNATURE='MSIE' # MS Explorer
SIGNATURE='MOSS' # Netscape
-_titlepat = regex.compile('<title>\([^<]*\)</title>')
+_titlepat = re.compile('<title>\([^<]*\)</title>')
def sucktitle(path):
f = open(path)
text = f.read(1024) # assume the title is in the first 1024 bytes
f.close()
lowertext = string.lower(text)
- if _titlepat.search(lowertext) > 0:
- a, b = _titlepat.regs[1]
- return text[a:b]
+ matcher = _titlepat.search(lowertext)
+ if matcher:
+ return matcher.group(1)
return path
def verifydocpath(docpath):