# Path: helper/scheduler.py
# def schedule(every):
#     def decorator(task):
#         task.every = every
#         return task
#     return decorator
# 
# Path: helper/utils/decorators.py
# def format_options_from_event(func):
#     def wrapper(data, **kwargs):
# 
# Path: helper/agents/utils.py
# def send_to_event_store(data, task_pair_id, task_type):
#     Event.objects.create(data={k: json.dumps(v) for k, v in data.items()},
#                             task_pair_id=task_pair_id, task_type=task_type)


import time
import datetime
import feedparser
from celery import shared_task
from django import forms
from helper.scheduler import schedule
from helper.utils.decorators import dedup, format_options_from_event
from helper.agents.utils import send_to_event_store



def struct2isoformat(struct):
    if struct is None:
        return ''
    return datetime.datetime.fromtimestamp(time.mktime(struct)).isoformat()


@schedule(1)

# Path: helper/scheduler.py
# def schedule(every):
#     def decorator(task):
#         task.every = every
#         return task
#     return decorator
# 
# Path: helper/utils/decorators.py
# def format_options_from_event(func):
#     def wrapper(data, **kwargs):
# 
# Path: helper/agents/utils.py
# def send_to_event_store(data, task_pair_id, task_type):
#     Event.objects.create(data={k: json.dumps(v) for k, v in data.items()},
#                             task_pair_id=task_pair_id, task_type=task_type)


# Path: helper/agents/rss/tasks.py
import time
import datetime
import feedparser
from celery import shared_task
from django import forms
from helper.scheduler import schedule
from helper.utils.decorators import dedup, format_options_from_event
from helper.agents.utils import send_to_event_store




def struct2isoformat(struct):
    if struct is None:
        return ''
    return datetime.datetime.fromtimestamp(time.mktime(struct)).isoformat()


@schedule(1)

@dedup('id')