def call(self):
     url = self._data.get('distribution_url')
     full_url = files.full_url_by_relative(url)
     filename = os.path.basename(url)
     full_localpath = os.path.join('/tmp', filename)
     threads.run_in_thread(self._download,
                           [full_url, full_localpath, self._sequence])
Beispiel #2
0
def app():
    with rw_fs.Storage(restart_player=False):
        hardware.platfrom.fix_file_permissions(config.Config().storage_path())

    xmain.start()
    wallpaper.Wallpaper().load()

    if config.Config().enable_clockd():
        threads.run_in_thread(clockd.Clockd().run)

    # threads.run_in_thread(networkd.Networkd().run)

    # threads.run_in_thread(hdmihotplug.HdmiHotplug(onchange_callback=resolution_changed).run)

    player = playercontroller.PlayerController()
    player.start_playlist()

    proto = protocoldispatcher.ProtocolDispatcher()

    threads.run_in_thread(webui.start, ['0.0.0.0', 8080])
    while True:
        track = player.current_track_name()
        pos = player.current_track_posiotion()
        proto.send('now_playing', track=track, percent_position=pos)
        watchdog.Watchdog().feed()
        time.sleep(20)
Beispiel #3
0
 def __init__(self):
     self._player = None
     self._rx = queue.Queue()
     self._tx = queue.Queue()
     self._stop_flag = False
     self._atomic_lock = threading.Lock()
     threads.run_in_thread(self._serve)
Beispiel #4
0
 def __init__(self):
     self._callbacks = None
     self._guard = guard.Guard()
     self._expected_state = ('stopped', {})
     self._stop_flag = False
     self._watchdog = wdt.Watchdog()
     self._rx = queue.Queue()
     self._tx = queue.Queue()
     self._atomic_lock = threading.Lock()
     threads.run_in_thread(self._check_state_loop)
 def __init__(self):
     self._stop_flag = False
     self._seek_position = 0
     self._max_duration = 0
     self._started = False
     self._filename = None
     self._timer_thread = threads.run_in_thread(self._timer_loop)
Beispiel #6
0
 def __init__(self):
     self._proc = self._spawn_process()
     super().__init__()
     self._last_command = None
     threads.run_in_thread(self._watchdog)
Beispiel #7
0
 def start(self):
     self._reader_thread = threads.run_in_thread(self._reader)
     self._writer_thread = threads.run_in_thread(self._writer)
Beispiel #8
0
 def start(self):
     self._thread = threads.run_in_thread(self._run)
 def onreceive(self, msg, seq):
     log.debug("received message: '%s'", str(msg))
     threads.run_in_thread(target=self._receive_protocol_callback, args=(msg, seq))