Fix IndentationError in init_database function and add missing Python app files#24
Draft
Fix IndentationError in init_database function and add missing Python app files#24
Conversation
Co-authored-by: Dreamersseve <117508971+Dreamersseve@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix indentation error in app.py
Fix IndentationError in init_database function and add missing Python app files
Sep 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The repository was missing critical Python application files (
app.pyandrun.py) that are referenced in the project but were not present in the codebase. When attempting to runpython3 run.py, users encountered anIndentationError: unexpected indentat line 32 around theconn = sqlite3.connect(app.config['DATABASE_PATH'])statement in theinit_databasefunction.Solution
This PR addresses the issue by:
app.pyandrun.pyfilesinit_databasefunction by ensuring consistent 4-space indentation throughoutsqlite3import at the top of the fileChanges Made
app.pyinit_database()function with correct 4-space indentationsqlite3import statement at the top of the filemessagesanduserstablesrun.pyTesting
The fix has been verified with:
python3 -m py_compile app.pypasses without errorsinit_database()completes successfullypython3 run.pynow starts without IndentationErrorBefore & After
Before:
After:
This resolves the
IndentationError: unexpected indentissue and allows the Python application to run successfully alongside the existing C++ backend components.This pull request was created as a result of the following prompt from Copilot chat.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.