-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest-script.py
39 lines (30 loc) · 1012 Bytes
/
test-script.py
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
32
33
34
35
36
37
38
39
"""My testing script"""
import obs
import obs.props as OP
import requests
from time import sleep
PROPERTIES = [
OP.SceneItemList("scene", "Scenes"),
OP.Button("button", "Button Text", print, doc="Clicking this button will do something"),
OP.Button("disbutton", "Dis Button", print, enabled=False, doc="'Dis' means 'Disabled' :3"),
OP.Font("font", "Font"),
OP.Group("urltext", "Text from URL", checkable=True, default=False, elements=[
OP.Text("url", "URL", default="https://example.com/"),
OP.Number("interval", "Time", 1, 30, 0.5, suffix=" s"),
OP.TextSources("source", "Source"),
]),
]
def on_scene_changed(new_value):
print(new_value)
VALUES = {}
def do_switching():
while True:
if not VALUES["urltext"]:
return
sleep(max(VALUES["interval"], 1))
#r = requests.get(VALUES["url"])
#r.raise_for_status()
#VALUES["source"]["text"] = r.text
def on_update():
print(VALUES)
obs.ready(globals())