Skip to content

Conversation

@gmmcosta15
Copy link
Collaborator

@gmmcosta15 gmmcosta15 commented Jan 5, 2026

Description

Select the type:

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

files.py:

  • Add credential section handling for specifying usernames.
  • Add udiskie section config handling for defining automount paths.
  • Create symlink in ~/home/printer_data/USB/ mapping the username to its udiskie automount path.
  • Ensure symlink is recreated when the user clicks the printer button.

moonrakerComm.py:

  • Add JSON‑RPC API methods to support future implementations.

moonrest.py:

  • Add HTTP endpoints for interacting with Moonraker.
  • Add ability to send files using the _post request method.

helper_methods.py:

  • Add method to check if a process is running.
  • Add method to calculate the SHA‑256 hash of a file.

logger.py:

  • Automatically create logs directory if it does not already exist

BlocksScreen.cfg:

  • Add the two new configuration sections, credential and udiskie.

Motivation

  • User credential and automount support - Previously, there was no standardized way for users to define their username or specify USB automount paths. Adding credential and udiskie sections in the configuration improves usability and lets users tailor the system to their environment.
  • Reliable symlink creation - A symlink in ~/home/printer_data/USB now consistently maps the configured username to the appropriate udiskie automount path. The implementation ensures this symlink is created and recreated when necessary (e.g., when the user clicks the printer button), enhancing consistency.
  • Foundation for future features - The added JSON-RPC methods and new HTTP endpoints for Moonraker lay the groundwork for future integrations and remote interactions. These additions improve the extensibility of the API for upcoming features.
  • Reusable helpers - New helper methods for checking whether a process is running and computing the SHA-256 hash of a file provide core utility functions that can be reused throughout the codebase.
  • Improved configuration - By adding new sections to BlocksScreen.cfg, users have more flexibility and control over how the system behaves without modifying source code

Tests

Tested with standard testcases,
Missing Unit and Integration Tests,

Delete section if not applicable.

Future work

Creating unit and integration tests for all endpoints created

Added a credential section for users to add their username.
Added a udiskie section for users to specify automount paths.
Creates a symlink in ~/home/printer_data/USB that maps the username from the credential section to the corresponding udiskie automount path.
Ensures the symlink is recreated when the user clicks the printer button.

moonrakerComm.py:
Added JSON‑RPC API methods to support future implementations.

moonrest.py:
Added endpoints to interact with Moonraker over HTTP.
Added the ability to send files via the _post request method.

helper_methods.py:
Added a method to check if a process is running.
Added a method to calculate the SHA‑256 hash of a file.

BlocksScreen.cfg:
Added two new configuration sections.
@gmmcosta15 gmmcosta15 requested a review from HugoCLSC January 5, 2026 16:37
@gmmcosta15 gmmcosta15 self-assigned this Jan 5, 2026
@gmmcosta15 gmmcosta15 added the enhancement New feature or request. label Jan 5, 2026
@gmmcosta15 gmmcosta15 marked this pull request as ready for review January 5, 2026 16:51
@gmmcosta15 gmmcosta15 closed this Jan 5, 2026
@gmmcosta15 gmmcosta15 reopened this Jan 5, 2026
gmmcosta15 and others added 2 commits January 5, 2026 17:35
Signed-off-by: Guilherme Costa <guilherme.costa@blockstec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants