FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Dragonfire-RaspberryPi/api.py at master · DragonComputer/Dragonfire-RaspberryPi · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DragonComputer
/
Dragonfire-RaspberryPi
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
17
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Dragonfire-RaspberryPi
/
api.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (30 loc) · 952 Bytes
Breadcrumbs
Dragonfire-RaspberryPi
/
api.py
Copy path
File metadata and controls
executable file
·
31 lines (30 loc) · 952 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
import
subprocess
import
time
import
os
songRunning
=
False
class
Data
:
def
__init__
(
self
,
com
=
""
,
msg
=
""
,
sp
=
"False"
):
self
.
command
=
com
self
.
message
=
msg
self
.
speak
=
sp
def
interact
(
self
,
duration
):
#subprocess.Popen(["notify-send","Dragonfire", self.message])
os
.
system
(
"xbmc-send --action=
\"
Notification(
\"
Dragonfire
\"
,"
+
self
.
message
+
")
\"
"
)
if
self
.
command
!=
""
:
time
.
sleep
(
duration
)
subprocess
.
Popen
(
self
.
command
,
stdout
=
subprocess
.
PIPE
)
#if self.speak == True:
# self.say(self.message)
#else:
def
say
(
self
,
message
):
#if songRunning == True:
# subprocess.Popen(["rhythmbox-client","--pause"])
proc
=
subprocess
.
Popen
([
"festival"
,
"--tts"
],
stdin
=
subprocess
.
PIPE
)
proc
.
stdin
.
write
(
message
)
proc
.
stdin
.
close
()
#proc.wait()
#if songRunning == True:
# subprocess.Popen(["rhythmbox-client","--play"])
def
espeak
(
self
,
message
):
subprocess
.
Popen
([
"espeak"
,
"-v"
,
"en-uk-north"
,
message
])
Back
|
FazBrowse Home
|
New Git URL