summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-10-19 09:19:28 -0700
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-10-19 11:19:27 -0500
commit69aea3980e2e3c848ae1c7b0ce7539bbdc8daf27 (patch)
tree3d7ddf5bce1982a4ed217dd5fbeaf59c08d74ad7 /examples
parentb268114a0da1dc306cdcb9359ffa5a09bd99089f (diff)
downloadpyparsing-git-69aea3980e2e3c848ae1c7b0ce7539bbdc8daf27.tar.gz
Remove unused imports (#147)
Discovered using the command: flake8 --select F401 .
Diffstat (limited to 'examples')
-rw-r--r--examples/SimpleCalc.py2
-rw-r--r--examples/fourFn.py2
-rw-r--r--examples/htmlStripper.py3
-rw-r--r--examples/protobuf_parser.py2
-rw-r--r--examples/sexpParser.py1
-rw-r--r--examples/simpleSQL.py4
-rw-r--r--examples/urlExtractorNew.py1
7 files changed, 6 insertions, 9 deletions
diff --git a/examples/SimpleCalc.py b/examples/SimpleCalc.py
index d52a20f..5e1d835 100644
--- a/examples/SimpleCalc.py
+++ b/examples/SimpleCalc.py
@@ -33,7 +33,7 @@ debug_flag=False
variables = {}
-from fourFn import BNF, exprStack, fn, opn, evaluate_stack
+from fourFn import BNF, exprStack, evaluate_stack
# from fourFn import BNF, exprStack, fn, opn
# def evaluateStack( s ):
diff --git a/examples/fourFn.py b/examples/fourFn.py
index e07125f..e5be215 100644
--- a/examples/fourFn.py
+++ b/examples/fourFn.py
@@ -11,7 +11,7 @@
# Copyright 2003-2019 by Paul McGuire
#
from pyparsing import (Literal, Word, Group, Forward, alphas, alphanums, Regex, ParseException,
- CaselessKeyword, Suppress, delimitedList, pyparsing_common as ppc, tokenMap)
+ CaselessKeyword, Suppress, delimitedList)
import math
import operator
diff --git a/examples/htmlStripper.py b/examples/htmlStripper.py
index eb35c70..bd99b77 100644
--- a/examples/htmlStripper.py
+++ b/examples/htmlStripper.py
@@ -6,10 +6,9 @@
#
# Copyright (c) 2006, 2016, Paul McGuire
#
-import urllib.parse, urllib.error
from urllib.request import urlopen
from pyparsing import (makeHTMLTags, commonHTMLEntity, replaceHTMLEntity,
- htmlComment, anyOpenTag, anyCloseTag, LineEnd, OneOrMore, replaceWith)
+ htmlComment, anyOpenTag, anyCloseTag, LineEnd, replaceWith)
scriptOpen, scriptClose = makeHTMLTags("script")
scriptBody = scriptOpen + scriptOpen.tag_body + scriptClose
diff --git a/examples/protobuf_parser.py b/examples/protobuf_parser.py
index 52ce434..e1657b4 100644
--- a/examples/protobuf_parser.py
+++ b/examples/protobuf_parser.py
@@ -6,7 +6,7 @@
#
from pyparsing import (Word, alphas, alphanums, Regex, Suppress, Forward,
- Keyword, Group, oneOf, ZeroOrMore, Optional, delimitedList,
+ Group, oneOf, ZeroOrMore, Optional, delimitedList,
restOfLine, quotedString, Dict)
ident = Word(alphas+"_",alphanums+"_").setName("identifier")
diff --git a/examples/sexpParser.py b/examples/sexpParser.py
index 0d006d2..f678d9a 100644
--- a/examples/sexpParser.py
+++ b/examples/sexpParser.py
@@ -45,7 +45,6 @@ BNF reference: http://theory.lcs.mit.edu/~rivest/sexp.txt
import pyparsing as pp
from base64 import b64decode
-import pprint
def verify_length(s, l, t):
diff --git a/examples/simpleSQL.py b/examples/simpleSQL.py
index ac4de17..60582cd 100644
--- a/examples/simpleSQL.py
+++ b/examples/simpleSQL.py
@@ -8,11 +8,11 @@
from pyparsing import Word, delimitedList, Optional, \
Group, alphas, alphanums, Forward, oneOf, quotedString, \
infixNotation, opAssoc, \
- ZeroOrMore, restOfLine, CaselessKeyword, pyparsing_common as ppc
+ restOfLine, CaselessKeyword, pyparsing_common as ppc
# define SQL tokens
selectStmt = Forward()
-SELECT, FROM, WHERE, AND, OR, IN, IS, NOT, NULL = map(CaselessKeyword,
+SELECT, FROM, WHERE, AND, OR, IN, IS, NOT, NULL = map(CaselessKeyword,
"select from where and or in is not null".split())
NOT_NULL = NOT + NULL
diff --git a/examples/urlExtractorNew.py b/examples/urlExtractorNew.py
index 795322a..14f6eb1 100644
--- a/examples/urlExtractorNew.py
+++ b/examples/urlExtractorNew.py
@@ -1,7 +1,6 @@
# URL extractor
# Copyright 2004, Paul McGuire
from pyparsing import makeHTMLTags
-import urllib.parse, urllib.error
from urllib.request import urlopen
import pprint