summaryrefslogtreecommitdiff
path: root/examples/urlExtractor.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2019-01-30 20:41:33 -0600
committerptmcg <ptmcg@austin.rr.com>2019-01-30 20:41:33 -0600
commit3157a77c9584a69839db0f8274c87438b912e99b (patch)
tree5e93a6e21715f9afcbc55eba56f4a5f962b67a46 /examples/urlExtractor.py
parentf10a02039a6039f8a42b0cc99bea51623676cf01 (diff)
downloadpyparsing-git-3157a77c9584a69839db0f8274c87438b912e99b.tar.gz
Update examples and unit tests to more preferred coding styles, imports for pyparsing_common as ppc and pyparsing_unicode as ppu
Diffstat (limited to 'examples/urlExtractor.py')
-rw-r--r--examples/urlExtractor.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/urlExtractor.py b/examples/urlExtractor.py
index dc88608..e4299b9 100644
--- a/examples/urlExtractor.py
+++ b/examples/urlExtractor.py
@@ -1,6 +1,6 @@
# URL extractor
# Copyright 2004, Paul McGuire
-from pyparsing import makeHTMLTags, SkipTo, pyparsing_common
+from pyparsing import makeHTMLTags, SkipTo, pyparsing_common as ppc
import urllib.request
from contextlib import closing
import pprint
@@ -8,7 +8,7 @@ import pprint
linkOpenTag, linkCloseTag = makeHTMLTags('a')
linkBody = SkipTo(linkCloseTag)
-linkBody.setParseAction(pyparsing_common.stripHTMLTags)
+linkBody.setParseAction(ppc.stripHTMLTags)
linkBody.addParseAction(lambda toks: ' '.join(toks[0].strip().split()))
link = linkOpenTag + linkBody("body") + linkCloseTag.suppress()