Skip to content

Commit

Permalink
invregex -> invregexp
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Oct 28, 2012
1 parent 2396b00 commit 93446a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions spyne/protocol/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ def __init__(self, address, verb=None, host=None, endpoint=None):

def as_werkzeug_rule(self):
from werkzeug.routing import Rule
from spyne.util.invregex import invregex
from spyne.util.invregexp import invregexp

methods = None
if self.verb is not None:
methods = invregex(self.verb)
methods = invregexp(self.verb)

return Rule(self.address, host=self.host, endpoint=self.endpoint,
methods=methods)
10 changes: 5 additions & 5 deletions spyne/util/invregex.py → spyne/util/invregexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# - | alternation
#

__all__ = ["count", "invregex"]
__all__ = ["count", "invregexp"]

from pyparsing import Combine
from pyparsing import Literal
Expand Down Expand Up @@ -227,10 +227,10 @@ def count(gen):
return i


def invregex(regex):
def invregexp(regex):
"""Call this routine as a generator to return all the strings that
match the input regular expression.
for s in invregex("[A-Z]{3}\d{3}"):
for s in invregexp("[A-Z]{3}\d{3}"):
print s
"""
invReGenerator = GroupEmitter(parser().parseString(regex)).make_generator()
Expand Down Expand Up @@ -278,8 +278,8 @@ def main():
print '-' * 50
print t
try:
print count(invregex(t))
for s in invregex(t):
print count(invregexp(t))
for s in invregexp(t):
print s

except ParseFatalException,pfe:
Expand Down

0 comments on commit 93446a3

Please sign in to comment.