MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / push_source

Method push_source

tools/python-3.11.9-amd64/Lib/shlex.py:78–90  ·  view source on GitHub ↗

Push an input source onto the lexer's input source stack.

(self, newstream, newfile=None)

Source from the content-addressed store, hash-verified

76 self.pushback.appendleft(tok)
77
78 def push_source(self, newstream, newfile=None):
79 "Push an input source onto the lexer's input source stack."
80 if isinstance(newstream, str):
81 newstream = StringIO(newstream)
82 self.filestack.appendleft((self.infile, self.instream, self.lineno))
83 self.infile = newfile
84 self.instream = newstream
85 self.lineno = 1
86 if self.debug:
87 if newfile is not None:
88 print('shlex: pushing to file %s' % (self.infile,))
89 else:
90 print('shlex: pushing to stream %s' % (self.instream,))
91
92 def pop_source(self):
93 "Pop the input source stack."

Callers 1

get_tokenMethod · 0.95

Calls 2

StringIOClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected