ffplayout/test/run_time_machine.py

27 lines
535 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import os
import sys
from zoneinfo import ZoneInfo
import time_machine
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
2021-02-11 09:28:15 +01:00
# set time zone
_TZ = ZoneInfo("Europe/Berlin")
# fake date and time
SOURCE_TIME = [2021, 2, 8, 23, 59, 50]
2021-02-11 09:28:15 +01:00
@time_machine.travel(datetime.datetime(*SOURCE_TIME, tzinfo=_TZ))
def run_in_time_machine():
desktop.output()
if __name__ == '__main__':
2021-02-09 16:29:58 +01:00
from ffplayout.output import desktop
run_in_time_machine()