arkrow / PyMusicLooper

A python program for repeating music endlessly and creating seamless music loops, with play/export/tagging support.
https://pypi.org/project/pymusiclooper/
MIT License
261 stars 25 forks source link

add flask and invoke methods directly without need of cli #39

Closed iamsinghal closed 4 months ago

iamsinghal commented 4 months ago

Summary by Sourcery

This pull request refactors the CLI to accept keyword arguments, introduces a Flask server to invoke methods directly, and enhances the handler to return loop pairs for further processing.

sourcery-ai[bot] commented 4 months ago

Reviewer's Guide by Sourcery

This pull request refactors the pymusiclooper CLI to allow direct invocation of methods without the need for CLI commands, and introduces a Flask server to handle requests programmatically. The changes include modifying the cli_main function to accept a dictionary of arguments, updating command functions to be callable directly, and adding a new Flask server in server.py to handle HTTP requests.

File-Level Changes

Files Changes
pymusiclooper/cli.py
pymusiclooper/handler.py
Refactored CLI functions to support direct method invocation and added functionality to return results for further processing.
server.py Added a new Flask server to handle HTTP requests and invoke cli_main programmatically.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
iamsinghal commented 4 months ago

This PR is not intended to be here in this repo.