Commit dbbf76bd authored by Fred Drake's avatar Fred Drake

Make tabnanny happy.

mailbox.py: Convert to 4-space indents.
parent c2844af8
This diff is collapsed.
...@@ -17,7 +17,8 @@ class shlex: ...@@ -17,7 +17,8 @@ class shlex:
self.instream = sys.stdin self.instream = sys.stdin
self.infile = None self.infile = None
self.commenters = '#' self.commenters = '#'
self.wordchars = 'abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_' self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_')
self.whitespace = ' \t\r\n' self.whitespace = ' \t\r\n'
self.quotes = '\'"' self.quotes = '\'"'
self.state = ' ' self.state = ' '
...@@ -25,7 +26,7 @@ class shlex: ...@@ -25,7 +26,7 @@ class shlex:
self.lineno = 1 self.lineno = 1
self.debug = 0 self.debug = 0
self.token = '' self.token = ''
self.filestack = [] self.filestack = []
self.source = None self.source = None
if self.debug: if self.debug:
print 'shlex: reading from %s, line %d' \ print 'shlex: reading from %s, line %d' \
...@@ -45,7 +46,7 @@ class shlex: ...@@ -45,7 +46,7 @@ class shlex:
if self.debug >= 1: if self.debug >= 1:
print "shlex: popping token " + `tok` print "shlex: popping token " + `tok`
return tok return tok
# No pushback. Get a token. # No pushback. Get a token.
raw = self.read_token() raw = self.read_token()
# Handle inclusions # Handle inclusions
while raw == self.source: while raw == self.source:
...@@ -88,18 +89,18 @@ class shlex: ...@@ -88,18 +89,18 @@ class shlex:
if self.debug >= 3: if self.debug >= 3:
print "shlex: in state", repr(self.state), \ print "shlex: in state", repr(self.state), \
"I see character:", repr(nextchar) "I see character:", repr(nextchar)
if self.state == None: if self.state is None:
self.token = ''; # past end of file self.token = ''; # past end of file
break break
elif self.state == ' ': elif self.state == ' ':
if not nextchar: if not nextchar:
self.state = None; # end of file self.state = None; # end of file
break break
elif nextchar in self.whitespace: elif nextchar in self.whitespace:
if self.debug >= 2: if self.debug >= 2:
print "shlex: I see whitespace in whitespace state" print "shlex: I see whitespace in whitespace state"
if self.token: if self.token:
break # emit current token break # emit current token
else: else:
continue continue
elif nextchar in self.commenters: elif nextchar in self.commenters:
...@@ -114,7 +115,7 @@ class shlex: ...@@ -114,7 +115,7 @@ class shlex:
else: else:
self.token = nextchar self.token = nextchar
if self.token: if self.token:
break # emit current token break # emit current token
else: else:
continue continue
elif self.state in self.quotes: elif self.state in self.quotes:
...@@ -124,14 +125,14 @@ class shlex: ...@@ -124,14 +125,14 @@ class shlex:
break break
elif self.state == 'a': elif self.state == 'a':
if not nextchar: if not nextchar:
self.state = None; # end of file self.state = None; # end of file
break break
elif nextchar in self.whitespace: elif nextchar in self.whitespace:
if self.debug >= 2: if self.debug >= 2:
print "shlex: I see whitespace in word state" print "shlex: I see whitespace in word state"
self.state = ' ' self.state = ' '
if self.token: if self.token:
break # emit current token break # emit current token
else: else:
continue continue
elif nextchar in self.commenters: elif nextchar in self.commenters:
...@@ -145,7 +146,7 @@ class shlex: ...@@ -145,7 +146,7 @@ class shlex:
print "shlex: I see punctuation in word state" print "shlex: I see punctuation in word state"
self.state = ' ' self.state = ' '
if self.token: if self.token:
break # emit current token break # emit current token
else: else:
continue continue
result = self.token result = self.token
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment