示例#1
0
文件: main.py 项目: amol9/fbstats
def remove():
    'Remove schedule.'

    try:
        scheduler = get_scheduler()
        scheduler.remove()
        print('schedule removed..')

    except (PlatformError, FrequencyError) as e:
        print(e)
        raise CommandError()
示例#2
0
文件: main.py 项目: amol9/fbstats
def remove():
    "Remove schedule."

    try:
        scheduler = get_scheduler()
        scheduler.remove()
        print("schedule removed..")

    except (PlatformError, FrequencyError) as e:
        print(e)
        raise CommandError()
示例#3
0
文件: main.py 项目: amol9/fbstats
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"
示例#4
0
文件: main.py 项目: amol9/fbstats
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'