Exemple #1
0
    def handle(self, *args, **options):
        sources = PluginFactory.get_periodic_poll_sources()
        for source in sources:
            if not source.enabled():
                continue

            s = source()
            s.poll()
Exemple #2
0
    def handle(self, *args, **options):
        sources = PluginFactory.get_periodic_poll_sources()
        for source in sources:
            if not source.enabled():
                continue

            s = source()
            s.poll()
Exemple #3
0
def timeline_push(request, source_id):
    """
    Accepts any request to this URL and routes it to the correct PushSource
    based upon name.
    """
    sources = PluginFactory.get_push_source_by_id(source_id)
    if not sources:
        raise Http404()

    for source in sources:
        s = source()
        s.push(request)

    return HttpResponse()
Exemple #4
0
def timeline_push(request, source_id):
    """
    Accepts any request to this URL and routes it to the correct PushSource
    based upon name.
    """
    sources = PluginFactory.get_push_source_by_id(source_id)
    if not sources:
        raise Http404()

    for source in sources:
        s = source()
        s.push(request)

    return HttpResponse()
Exemple #5
0
def timeline_event_detail(request, event_id):
    """
    Returns a partial HTML page which describes the event in detail if
    available, otherwise returns a blank page.

    This page is cached for 15 minutes, as it is likely to be expensive to
    generate.
    """
    event = get_object_or_404(Event, pk=event_id)
    viewer = PluginFactory.get_detailed_viewer_for(event)
    if not viewer:
        return HttpResponse()

    view = viewer()
    return view.render(request, event)
Exemple #6
0
def timeline_event_detail(request, event_id):
    """
    Returns a partial HTML page which describes the event in detail if
    available, otherwise returns a blank page.

    This page is cached for 15 minutes, as it is likely to be expensive to
    generate.
    """
    event = get_object_or_404(Event, pk=event_id)
    viewer = PluginFactory.get_detailed_viewer_for(event)
    if not viewer:
        return HttpResponse()

    view = viewer()
    return view.render(request, event)