shlex.shlex.push_source()

shlex.push_source(newstream, newfile=None) Push an input source stream onto the input stack. If the filename argument is specified it will later be available for use in error messages. This is the same method used internally by the sourcehook() method.

shlex.shlex.pop_source()

shlex.pop_source() Pop the last-pushed input source from the input stack. This is the same method used internally when the lexer reaches EOF on a stacked input stream.

shlex.shlex.lineno

shlex.lineno Source line number (count of newlines seen so far plus one).

shlex.shlex.instream

shlex.instream The input stream from which this shlex instance is reading characters.

shlex.shlex.infile

shlex.infile The name of the current input file, as initially set at class instantiation time or stacked by later source requests. It may be useful to examine this when constructing error messages.

shlex.shlex.get_token()

shlex.get_token() Return a token. If tokens have been stacked using push_token(), pop a token off the stack. Otherwise, read one from the input stream. If reading encounters an immediate end-of-file, eof is returned (the empty string ('') in non-POSIX mode, and None in POSIX mode).

shlex.shlex.escapedquotes

shlex.escapedquotes Characters in quotes that will interpret escape characters defined in escape. This is only used in POSIX mode, and includes just '"' by default.

shlex.shlex.escape

shlex.escape Characters that will be considered as escape. This will be only used in POSIX mode, and includes just '\' by default.

shlex.shlex.error_leader()

shlex.error_leader(infile=None, lineno=None) This method generates an error message leader in the format of a Unix C compiler error label; the format is '"%s", line %d: ', where the %s is replaced with the name of the current source file and the %d with the current input line number (the optional arguments can be used to override these). This convenience is provided to encourage shlex users to generate error messages in the standard, parseable format understood by Emacs and other Unix tools.

shlex.shlex.eof

shlex.eof Token used to determine end of file. This will be set to the empty string (''), in non-POSIX mode, and to None in POSIX mode.