MCPcopy Index your code
hub / github.com/RustPython/RustPython / runsource

Method runsource

Lib/sqlite3/__main__.py:45–70  ·  view source on GitHub ↗

Override runsource, the core of the InteractiveConsole REPL. Return True if more input is needed; buffering is done automatically. Return False if input is a complete statement ready for execution.

(self, source, filename="<input>", symbol="single")

Source from the content-addressed store, hash-verified

43 self._cur = connection.cursor()
44
45 def runsource(self, source, filename="<input>", symbol="single"):
46 """Override runsource, the core of the InteractiveConsole REPL.
47
48 Return True if more input is needed; buffering is done automatically.
49 Return False if input is a complete statement ready for execution.
50 """
51 if not source or source.isspace():
52 return False
53 if source[0] == ".":
54 match source[1:].strip():
55 case "version":
56 print(f"{sqlite3.sqlite_version}")
57 case "help":
58 print("Enter SQL code and press enter.")
59 case "quit":
60 sys.exit(0)
61 case "":
62 pass
63 case _ as unknown:
64 self.write("Error: unknown command or invalid arguments:"
65 f' "{unknown}".\n')
66 else:
67 if not sqlite3.complete_statement(source):
68 return True
69 execute(self._cur, source)
70 return False
71
72
73def main(*args):

Callers

nothing calls this directly

Calls 6

executeFunction · 0.85
printFunction · 0.50
isspaceMethod · 0.45
stripMethod · 0.45
exitMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected