mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-01-24 17:27:48 +00:00
upd examples to read conn from env
This commit is contained in:
parent
0512fac710
commit
7f3b0ac7c9
@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
|
|
||||||
@ -100,7 +101,14 @@ class App(tk.Tk):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
with vban_cmd.api('banana', ldirty=True) as vban:
|
KIND_ID = 'banana'
|
||||||
|
conn = {
|
||||||
|
'ip': os.environ.get('VBANCMD_IP', 'localhost'),
|
||||||
|
'port': int(os.environ.get('VBANCMD_PORT', 6980)),
|
||||||
|
'streamname': os.environ.get('VBANCMD_STREAMNAME', 'Command1'),
|
||||||
|
}
|
||||||
|
|
||||||
|
with vban_cmd.api(KIND_ID, ldirty=True, **conn) as vban:
|
||||||
app = App(vban)
|
app = App(vban)
|
||||||
app.mainloop()
|
app.mainloop()
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import threading
|
import threading
|
||||||
from logging import config
|
from logging import config
|
||||||
|
|
||||||
@ -92,8 +93,13 @@ class Observer:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
KIND_ID = 'potato'
|
KIND_ID = 'potato'
|
||||||
|
conn = {
|
||||||
|
'ip': os.environ.get('VBANCMD_IP', 'localhost'),
|
||||||
|
'port': int(os.environ.get('VBANCMD_PORT', 6980)),
|
||||||
|
'streamname': os.environ.get('VBANCMD_STREAMNAME', 'Command1'),
|
||||||
|
}
|
||||||
|
|
||||||
with vban_cmd.api(KIND_ID) as vban:
|
with vban_cmd.api(KIND_ID, **conn) as vban:
|
||||||
stop_event = threading.Event()
|
stop_event = threading.Event()
|
||||||
|
|
||||||
with Observer(vban, stop_event):
|
with Observer(vban, stop_event):
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
import vban_cmd
|
import vban_cmd
|
||||||
|
|
||||||
@ -23,8 +24,13 @@ class App:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
KIND_ID = 'banana'
|
KIND_ID = 'banana'
|
||||||
|
conn = {
|
||||||
|
'ip': os.environ.get('VBANCMD_IP', 'localhost'),
|
||||||
|
'port': int(os.environ.get('VBANCMD_PORT', 6980)),
|
||||||
|
'streamname': os.environ.get('VBANCMD_STREAMNAME', 'Command1'),
|
||||||
|
}
|
||||||
|
|
||||||
with vban_cmd.api(KIND_ID, pdirty=True, ldirty=True) as vban:
|
with vban_cmd.api(KIND_ID, pdirty=True, ldirty=True, **conn) as vban:
|
||||||
App(vban)
|
App(vban)
|
||||||
|
|
||||||
while _ := input('Press <Enter> to exit\n'):
|
while _ := input('Press <Enter> to exit\n'):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user