File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 3
3
from sys import stdin , stdout , exit , stderr
4
4
from pathlib import Path
5
5
from os import environ
6
- import sys
7
- import subprocess
6
+ from subprocess import run
8
7
9
8
from play_sounds import DEFAULT_SONG
10
9
from detect import unix as IS_UNIX
14
13
RC_OK = 0
15
14
RC_ENV_VAR = 1
16
15
ENV_VAR = 'ONHOLD'
17
- BLOCK_WHILE_PLAYING = True
16
+ PIPE_CMD = 'cat'
18
17
19
18
20
19
def is_pipeline () -> bool :
@@ -23,16 +22,16 @@ def is_pipeline() -> bool:
23
22
24
23
def dumb_pipe ():
25
24
if IS_UNIX :
26
- # if we're on unix, just redirect via shell
27
- subprocess . run (
28
- "cat" ,
25
+ # if we're on unix, redirect via shell
26
+ run (
27
+ PIPE_CMD ,
29
28
shell = True ,
30
- stdin = stdin ,
31
- stdout = stdout
29
+ stdin = stdin . buffer ,
30
+ stdout = stdout . buffer
32
31
)
33
32
34
33
else :
35
- # if we're on windows , iterate over stdin
34
+ # if we're some other platform , iterate over stdin
36
35
stdout .buffer .writelines (stdin .buffer )
37
36
38
37
Original file line number Diff line number Diff line change 4
4
5
5
6
6
NAME = "onhold"
7
- VERSION = "0.4.0 "
7
+ VERSION = "0.4.1 "
8
8
LICENSE = "AGPL-3.0"
9
9
10
10
DESC = "🔊 Play music while and after jobs complete"
You can’t perform that action at this time.
0 commit comments