Commit 98da206c authored by birk's avatar birk
Browse files

log latest media entry

parent bdb95f64
from datetime import datetime
from pathlib import Path
from pyglet.event import EventDispatcher
from display.mediadisplay import MediaDisplay
from system.config import Config
class Dispatcher(EventDispatcher):
......@@ -14,6 +18,7 @@ class Dispatcher(EventDispatcher):
for s in screens_:
self._program = None
self._config = Config()
def set_program(self, program_):
self._program = program_
......@@ -104,6 +109,7 @@ class Dispatcher(EventDispatcher):
media_display_ = MediaDisplay(media_entry_, screen_, self._program, index_)
def on_screen_ready(self, media_display_, screen_):
......@@ -136,6 +142,11 @@ class Dispatcher(EventDispatcher):
return self._program.length
return 0
def log_media(self, media_entry_):
with open(str(Path(self._config.log_dir,'last_media_entry.txt')), 'w') as f:
f.write('{} {}\n'.format('%H:%M:%S'),media_entry_.uuid))
class ScreenEntry():
def __init__(self, entry_, screen_=None, index_=None):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment