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

Add a command fileopen to open files in external programs #200

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rsekman
Copy link
Contributor

@rsekman rsekman commented Jul 29, 2021

No description provided.

@rndusr
Copy link
Owner

rndusr commented Aug 1, 2021 via email

@rsekman
Copy link
Contributor Author

rsekman commented Aug 9, 2021

Hi, thanks,

  1. Fixed.
  2. When running fopen mpv in the tui with files selected the intuitively expected behaviour is that the files are opened withmpv. This means that the two first arguments as the command is defined for the cli need to be filled in, so fopen mpv should "alias" to ~fopen torrentid=x file=movie.mkv mpv. Maybe it is better to have two base command classes? I am not super familiar with the structure of this code base yet so I don't know if that's possible or good.
  3. Fixed.
  4. Yes -- my use case was opening files in mpv so I did not want the logging input in stig. I'll look into your suggestion. Perhaps it would also be good to have a --quiet flag for fopen, but then we'd need a way to separate it from arguments to passed through (e.g. one could call fopen --quiet mpv --fullscreen and this would open the file fullscreened in mpv while suppressing all output.)
  5. Naturally -- is there documentation for writing tests? I'd need a mock transmission right?

@rndusr
Copy link
Owner

rndusr commented Aug 9, 2021 via email

subprocess.run blocks. This means that the child process must exit
before the user can contine to interact with stig. Using
subprocess.Popen instead  fixes this. Using pipes and asyncio, stdout
and stderr from the child process will appear asynchronously in the log.
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.

2 participants