Beispiel #1
0
def get_user_options():
    return Options.get_user_options()
Beispiel #2
0
import threading
import time
import schedule

from src.options import Options

WALL_SCHEDULE = 'WALL_SCHEDULE'
options = Options.get_user_options()

# Start schedule check loop
def start_loop():
	while True:
		schedule.run_pending()
		time.sleep(1)

thread = threading.Thread(target = start_loop)
thread.start()

def test():
	print('job')

class Scheduler():

	@classmethod
	def start(cls, interval = None, unit = 'minutes'):
		"""
		Restart the schedule on a new interval
		Arguments:
		interval (int): The time between wallpaper change
		unit (string)['minutes' | 'hours' | 'days' | 'weeks']: Unit of time used
		"""