Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix db handler #13

Merged
merged 9 commits into from
Jan 7, 2025
Merged

Fix db handler #13

merged 9 commits into from
Jan 7, 2025

Conversation

ghostleek
Copy link
Contributor

No description provided.

Assistant generated file changes:
- database.py: Fix cursor error handling

---

User prompt:

error:

UnboundLocalError: cannot access local variable 'cur' where it is not associated with a value
Traceback:
File "/home/runner/03b7bb86-8a74-463e-966e-bafe8cfb3d67/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/home/runner/03b7bb86-8a74-463e-966e-bafe8cfb3d67/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/home/runner/03b7bb86-8a74-463e-966e-bafe8cfb3d67/main.py", line 132, in <module>
    init_db()
File "/home/runner/03b7bb86-8a74-463e-966e-bafe8cfb3d67/database.py", line 29, in init_db
    cur.close()
Assistant generated file changes:
- attached_assets/favicon.png: Add favicon image
- main.py: Update page icon and title, Update title display

---

User prompt:

change the image and favicon to use this instead of the existing emoji
… error

Assistant generated file changes:
- main.py: Remove problematic image display, Update page icon to emoji

---

User prompt:

error:

PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fb3a6e11d50>
Traceback:
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/home/runner/strExitCard/main.py", line 134, in <module>
    main()
File "/home/runner/strExitCard/main.py", line 85, in main
    st.image("attached_assets/favicon.png", width=50)
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/metrics_util.py", line 409, in wrapped_func
    result = non_optional_func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/image.py", line 172, in image
    marshall_images(
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 438, in marshall_images
    proto_img.url = image_to_url(
                    ^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 332, in image_to_url
    image_format = _validate_image_format_string(image_data, output_format)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 111, in _validate_image_format_string
    pil_image = Image.open(io.BytesIO(image_data))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Assistant generated file changes:
- main.py: Add image icon next to title

---

User prompt:

use the image as the icon beside st.title as well
Assistant generated file changes:
- main.py: Update image path to use mark_green.png, Update page icon

---

User prompt:

error

PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f4282141670>
Traceback:
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
    exec(code, module.__dict__)
File "/home/runner/strExitCard/main.py", line 137, in <module>
    main()
File "/home/runner/strExitCard/main.py", line 87, in main
    st.image("attached_assets/favicon.png", width=50)
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/runtime/metrics_util.py", line 409, in wrapped_func
    result = non_optional_func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/image.py", line 172, in image
    marshall_images(
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 438, in marshall_images
    proto_img.url = image_to_url(
                    ^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 332, in image_to_url
    image_format = _validate_image_format_string(image_data, output_format)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/strExitCard/.pythonlibs/lib/python3.12/site-packages/streamlit/elements/lib/image_utils.py", line 111, in _validate_image_format_string
    pil_image = Image.open(io.BytesIO(image_data))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Assistant generated file changes:
- main.py: Adjust image and title layout

---

User prompt:

is it possible to have the image in the same line as "situate learning"?
Assistant generated file changes:
- main.py: Update app title and input descriptions, Update page title

---

User prompt:

let's change the copywriting

title: "Stretch learning!"
remove "what did you teach today"
change "enter today's lesson or topic" to "enter a concept you plan to teach to generate open-ended and interdisciplinary questions to stretch learning
Assistant generated file changes:
- .replit: Update deployment configuration
- .streamlit/config.toml: Add base path configuration

---

User prompt:

instead of qnsprompt, use the site chergpt.sg/situatelearning
@ghostleek ghostleek merged commit 8a3fcb1 into main Jan 7, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant