Eclectic Media Git toast / 1ab9dce
Various bugfixes Ariana Giroux 1 year, 3 months ago
2 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
3030
3131 def toast(body, title=''):
3232 message = Message(body, title)
33 p = Popen(parse_command(message), stdin=PIPE, stderr=PIPE)
33 p = Popen(parse_command(message), stdout=PIPE, stderr=PIPE)
3434 p.wait()
35 print(p.communicate())
35 stdout, stderr = p.communicate()
36
37 if len(stdout.decode('UTF-8').splitlines()) > 0:
38 print(stdout.decode('UTF-8'))
39 elif len(stderr.decode('UTF-8').splitlines()) > 0:
40 print(stderr.decode('UTF-8'))
33
44 @click.command()
55 @click.argument('message')
6 @click.option('-t', '--title', type=str)
7 def toast_command(body, title=''):
8 toast(body, title)
6 @click.option('-t', '--title', type=str, default='')
7 def toast_command(message, title=''):
8 toast(message, title)
99
1010
1111 toast_command()