- Changed shlex.split() method to have more useful and

meaningful parameters.
This commit is contained in:
Gustavo Niemeyer 2003-04-20 01:57:03 +00:00
parent cf146d31e7
commit 48f3dcc93e
3 changed files with 13 additions and 16 deletions

View file

@ -271,9 +271,11 @@ class shlex:
raise StopIteration
return token
def split(s, posix=True, spaces=True):
lex = shlex(s, posix=posix)
lex.whitespace_split = spaces
def split(s, comments=False):
lex = shlex(s, posix=True)
lex.whitespace_split = True
if not comments:
lex.commenters = ''
return list(lex)
if __name__ == '__main__':