# Path: sequere/utils.py
# def get_setting(name):
#     try:
#         return getattr(settings, 'SEQUERE_' + name)
#     except AttributeError:
#         return getattr(defaults, name)


from django.core.paginator import Paginator
from celery.task import task
from sequere.utils import get_setting
    from sequere.models import get_followers
    from sequere.contrib.timeline import app
    from . import Timeline
    from sequere import app
    from . import Timeline


    logger = dispatch_action.get_logger()

    action = app.backend.get_action(action_uid)

    paginator = Paginator(get_followers(action.actor),
                          get_setting('TIMELINE_DISPATCH_RANGE'))

    logger.info('Dispatch action %s to %s followers' % (action, paginator.count))

    for num_page in paginator.page_range:
        page = paginator.page(num_page)

        for obj, timestamp in page.object_list:
            if action.actor == obj:
                continue

            timeline = Timeline(obj)
            timeline.save(action, dispatch=dispatch)


def populate_actions(from_uid, to_uid, method, logger=None):


    from_instance = app.backend.get_from_uid(from_uid)

    to_instance = app.backend.get_from_uid(to_uid)

    paginator = Paginator(Timeline(from_instance).get_public(),

# Path: sequere/utils.py
# def get_setting(name):
#     try:
#         return getattr(settings, 'SEQUERE_' + name)
#     except AttributeError:
#         return getattr(defaults, name)


# Path: sequere/contrib/timeline/tasks.py
from django.core.paginator import Paginator
from celery.task import task
from sequere.utils import get_setting
    from sequere.models import get_followers
    from sequere.contrib.timeline import app
    from . import Timeline
    from sequere import app
    from . import Timeline



    logger = dispatch_action.get_logger()

    action = app.backend.get_action(action_uid)

    paginator = Paginator(get_followers(action.actor),
                          get_setting('TIMELINE_DISPATCH_RANGE'))

    logger.info('Dispatch action %s to %s followers' % (action, paginator.count))

    for num_page in paginator.page_range:
        page = paginator.page(num_page)

        for obj, timestamp in page.object_list:
            if action.actor == obj:
                continue

            timeline = Timeline(obj)
            timeline.save(action, dispatch=dispatch)


def populate_actions(from_uid, to_uid, method, logger=None):


    from_instance = app.backend.get_from_uid(from_uid)

    to_instance = app.backend.get_from_uid(to_uid)

    paginator = Paginator(Timeline(from_instance).get_public(),

                          get_setting('TIMELINE_POPULATE_RANGE'))