diff options
author | Hugo <hugovk@users.noreply.github.com> | 2018-08-21 15:40:38 +0300 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2018-08-21 15:40:38 +0300 |
commit | c3dba1ed5f9be226044c7ffaf1cd47adcc7482f4 (patch) | |
tree | 2c0c45c153434d0c6b78c0d5e51448933f959fb8 /examples/stateMachine2.py | |
parent | 444859662f1829f2d8068fb33cdc375427bf9b6c (diff) | |
download | pyparsing-git-c3dba1ed5f9be226044c7ffaf1cd47adcc7482f4.tar.gz |
Upgrade Python syntax with pyupgrade
Diffstat (limited to 'examples/stateMachine2.py')
-rw-r--r-- | examples/stateMachine2.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/stateMachine2.py b/examples/stateMachine2.py index eb6633d..748bb8b 100644 --- a/examples/stateMachine2.py +++ b/examples/stateMachine2.py @@ -66,10 +66,10 @@ def expand_state_definition(source, loc, tokens): # define all state classes
statedef.extend(
- "class %s(%s): pass" % (s,baseStateClass)
+ "class {}({}): pass".format(s,baseStateClass)
for s in states )
statedef.extend(
- "%s._next_state_class = %s" % (s,fromTo[s])
+ "{}._next_state_class = {}".format(s,fromTo[s])
for s in states if s in fromTo )
return indent + ("\n"+indent).join(statedef)+"\n"
@@ -107,9 +107,9 @@ def expand_named_state_definition(source,loc,tokens): " return self.transitionName",
])
statedef.extend(
- "%s = %sTransition()" % (tn,baseStateClass)
+ "{} = {}Transition()".format(tn,baseStateClass)
for tn in transitions)
- statedef.extend("%s.transitionName = '%s'" % (tn,tn)
+ statedef.extend("{}.transitionName = '{}'".format(tn,tn)
for tn in transitions)
# define base class for state classes
@@ -197,7 +197,7 @@ class SuffixImporter(object): # it probably isn't even a filesystem path
if sys.path_importer_cache.get(dirpath,False) is None:
checkpath = os.path.join(
- dirpath,'%s.%s' % (fullname,self.suffix))
+ dirpath,'{}.{}'.format(fullname,self.suffix))
yield checkpath
def find_module(self, fullname, path=None):
|