def remove(): 'Remove schedule.' try: scheduler = get_scheduler() scheduler.remove() print('schedule removed..') except (PlatformError, FrequencyError) as e: print(e) raise CommandError()
def remove(): "Remove schedule." try: scheduler = get_scheduler() scheduler.remove() print("schedule removed..") except (PlatformError, FrequencyError) as e: print(e) raise CommandError()
def add(frequency): """Add schedule. frequency: time frequency for changing wallpaper""" scheduler = get_scheduler() try: scheduler.schedule(frequency, "fbstats job", globals.scheduler_taskname) print("schedule created..") except (PlatformError, FrequencyError) as e: print(e) raise CommandError() add.__extrahelp__ = Scheduler.frequency_help + os.linesep add.__extrahelp__ += "If schedule already exists, it'll be overwritten"
def add(frequency): '''Add schedule. frequency: time frequency for changing wallpaper''' scheduler = get_scheduler() try: scheduler.schedule(frequency, 'fbstats job', globals.scheduler_taskname) print('schedule created..') except (PlatformError, FrequencyError) as e: print(e) raise CommandError() add.__extrahelp__ = Scheduler.frequency_help + os.linesep add.__extrahelp__ += 'If schedule already exists, it\'ll be overwritten'