Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-133447: Add basic color tosqlite3 CLI#133461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
erlend-aasland merged 16 commits intopython:mainfromStanFromIreland:color_step1
May 10, 2025
Merged
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
0a33388
Add
StanFromIrelandMay 5, 2025
e680c35
Import cleanup
StanFromIrelandMay 5, 2025
9bf179c
Merge branch 'main' into color_step1
StanFromIrelandMay 5, 2025
b456133
Highlight error messages
StanFromIrelandMay 5, 2025
8ef9217
Merge branch 'main' into color_step1
StanFromIrelandMay 6, 2025
ca015a1
Now with themes!
StanFromIrelandMay 6, 2025
2c06076
Simpler usage
StanFromIrelandMay 6, 2025
198399e
Fixup
StanFromIrelandMay 6, 2025
2a8c729
Simplify
ambvMay 6, 2025
a220442
Don't skip coloring errors on single-statement execution
ambvMay 6, 2025
e65d724
Also ignore color in the CLI test case
ambvMay 6, 2025
66711a0
Clean up
StanFromIrelandMay 6, 2025
62a0164
Fix line removal
StanFromIrelandMay 7, 2025
52ee84c
Merge branch 'main' into color_step1
StanFromIrelandMay 9, 2025
4ed5815
Lint
StanFromIrelandMay 9, 2025
4c0b52c
fixup! Lint
StanFromIrelandMay 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Merge branch 'main' into color_step1
  • Loading branch information
@StanFromIreland
StanFromIreland authoredMay 9, 2025
commit52ee84ce17a5856ab646088b7c7337f55563eefc
34 changes: 22 additions & 12 deletionsLib/sqlite3/__main__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,18 +54,28 @@ def runsource(self, source, filename="<input>", symbol="single"):
Return True if more input is needed; buffering is done automatically.
Return False if input is a complete statement ready for execution.
"""
match source:
case ".version":
print(f"{sqlite3.sqlite_version}")
case ".help":
print("Enter SQL code and press enter.")
case ".quit":
sys.exit(0)
case _:
if not sqlite3.complete_statement(source):
return True
theme = get_theme(force_no_color=not self._use_color)
execute(self._cur, source, theme=theme)
theme = get_theme(force_no_color=not self._use_color)

if not source or source.isspace():
return False
if source[0] == ".":
match source[1:].strip():
case "version":
print(f"{sqlite3.sqlite_version}")
case "help":
print("Enter SQL code and press enter.")
case "quit":
sys.exit(0)
case "":
pass
case _ as unknown:
t = theme.traceback
self.write(f'{t.type}Error{t.reset}:{t.message} unknown'
f'command or invalid arguments: "{unknown}".\n{t.reset}')
else:
if not sqlite3.complete_statement(source):
return True
execute(self._cur, source, theme=theme)
return False


Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2025 Movatter.jp