A feedback portal for OceanCrow using Pygame
Project description
OceanCrow Feedback Portal
The oceancrow-feedback package is a Python application that provides a feedback portal for the OceanCrow project. It features a graphical user interface (GUI) built with Pygame for displaying feedback and a file-based system to manage feedback stored in JSON files. The package supports updating feedback with replies and is cross-platform, working on Windows, macOS, and Linux.
Features
- Graphical Interface: Launches a Pygame-based UI to display feedback (basic blue screen, customizable for further UI development).
- Feedback Management: Updates feedback entries in JSON files with replies and status changes, using cross-platform file locking to ensure safe concurrent access.
- Command-Line Access: Run the portal or manage feedback via Python scripts.
- Scalability: Designed to handle multiple feedback files and support scalability (e.g., adjustable
player_count).
Installation
Install the package from PyPI:
pip install oceancrow-feedback
Requirements
Python 3.8 or higher
Dependencies (automatically installed):
pygame>=2.5.0
filelock>=3.15.0
Usage
Running the Feedback Portal
Launch the Pygame-based feedback portal:
oceancrow-feedback
This opens a window (currently a blue screen) where you can view or interact with feedback. Customize the UI by modifying the display_ui function in feedback.py.
Managing Feedback Programmatically
Update feedback in a JSON file using Python:
from oceancrow_feedback.feedback import update_feedback
# Example: Update feedback with ID 1 in feedback.json
update_feedback(["feedback.json"], 1, "Thank you for your feedback!")
The JSON file (feedback.json) should have a structure like:
[
{
"id": 1,
"text": "User feedback here",
"status": "new"
},
{
"id": 2,
"text": "Another feedback",
"status": "new"
}
]
Running update_feedback adds a reply field and sets status to "replied" for the specified ID.
For Non-Python Developers (C++/C#)
This is a Python package distributed via PyPI, so C++/C# developers cannot directly import it. However, you can interact with it in two ways:
Command-Line Interface (CLI): Run the portal or Python scripts via system calls. Example in C++:
#include <cstdlib>
int main() {
system("oceancrow-feedback");
return 0;
}
Example in C#:
using System.Diagnostics;
class Program {
static void Main() {
Process.Start("oceancrow-feedback");
}
}
Embedded Python: Embed a Python interpreter to call package functions. This requires Python installed and oceancrow-feedback installed via pip. Example in C# using Python.NET:
using Python.Runtime;
class Program {
static void Main() {
using (Py.GIL()) {
dynamic feedback = Py.Import("oceancrow_feedback.feedback");
feedback.update_feedback(new[] { "feedback.json" }, 1, "Thank you!");
}
}
}
See Python.NET (C#) or Python.h (C++) for setup details.
Development
Project Structure
oceancrow_feedback/
├── oceancrow_feedback/
│ ├── __init__.py
│ ├── feedback.py
│ └── __main__.py
├── tests/
│ ├── __init__.py
│ └── test_feedback.py
├── LICENSE
├── README.md
├── pyproject.toml
├── setup.cfg
├── .pytest.ini
└── MANIFEST.in
feedback.py: Core logic for the feedback portal and file management.
test_feedback.py: Unit tests for feedback functionality.
LICENSE: MIT License for open-source usage.
Running Tests
Install pytest:
pip install pytest
Run tests:
pytest tests/
Building and Publishing
To build and publish to PyPI (for maintainers):
pip install build twine
python -m build
twine check dist/*
twine upload --repository testpypi dist/* # TestPyPI
twine upload dist/* # PyPI
Contributing
Contributions are welcome! Please:
Fork the repository at github.com/OceanCrow-TT/oceancrow_feedback.
Create a feature branch (git checkout -b feature/your-feature).
Submit a pull request with clear descriptions.
Report issues at github.com/OceanCrow-TT/oceancrow_feedback/issues.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For questions, contact Sheldon Kenny Salmon at your x : oceancrowtt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oceancrow_feedback-0.1.0.tar.gz.
File metadata
- Download URL: oceancrow_feedback-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68bee9b52fe078a3223c17e8b608e9bba37fc4a98558efee49ab71578b33f547
|
|
| MD5 |
492f809565dd9ddceb4759364d05af66
|
|
| BLAKE2b-256 |
639e6f990144b8cac590db49653997b680e0fca5d3c08d1f45819feb7c02406d
|
File details
Details for the file oceancrow_feedback-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oceancrow_feedback-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fa9f82dc32be459a4f4aecbacfbbe9ab749ecf005e89de2bbd2916e3c93731c
|
|
| MD5 |
51d87d9ab15843ef7602c942af963960
|
|
| BLAKE2b-256 |
476117c6e654766f44058168ac241b93babd8658631030702138c4d6ffc392dd
|