# Path: sequere/signals.py

# 
# Path: sequere/contrib/timeline/tasks.py
# @task(name='sequere.timeline.tasks.import_actions')
# def import_actions(from_uid, to_uid):
#     populate_actions(from_uid, to_uid, 'save',
#                      logger=import_actions.get_logger())
# 
# @task(name='sequere.timeline.tasks.remove_actions')
# def remove_actions(from_uid, to_uid):
#     populate_actions(from_uid, to_uid, 'delete',
#                      logger=remove_actions.get_logger())
# 
# Path: sequere/utils.py
# def get_setting(name):
#     try:
#         return getattr(settings, 'SEQUERE_' + name)
#     except AttributeError:
#         return getattr(defaults, name)


from django.dispatch import receiver
from sequere.signals import followed, unfollowed
from .tasks import import_actions, remove_actions
from sequere.utils import get_setting
    from sequere import app
    from sequere import app





@receiver(followed)
def handle_follow(sender, from_instance, to_instance, *args, **kwargs):
    if not get_setting('TIMELINE_IMPORT_ACTIONS_ON_FOLLOW'):
        return


    import_actions.delay(to_uid=app.backend.get_uid(from_instance),
                         from_uid=app.backend.get_uid(to_instance))


@receiver(unfollowed)
def handle_unfollow(sender, from_instance, to_instance, *args, **kwargs):

# Path: sequere/signals.py

# 
# Path: sequere/contrib/timeline/tasks.py
# @task(name='sequere.timeline.tasks.import_actions')
# def import_actions(from_uid, to_uid):
#     populate_actions(from_uid, to_uid, 'save',
#                      logger=import_actions.get_logger())
# 
# @task(name='sequere.timeline.tasks.remove_actions')
# def remove_actions(from_uid, to_uid):
#     populate_actions(from_uid, to_uid, 'delete',
#                      logger=remove_actions.get_logger())
# 
# Path: sequere/utils.py
# def get_setting(name):
#     try:
#         return getattr(settings, 'SEQUERE_' + name)
#     except AttributeError:
#         return getattr(defaults, name)


# Path: sequere/contrib/timeline/models.py
from django.dispatch import receiver
from sequere.signals import followed, unfollowed
from .tasks import import_actions, remove_actions
from sequere.utils import get_setting
    from sequere import app
    from sequere import app






@receiver(followed)
def handle_follow(sender, from_instance, to_instance, *args, **kwargs):
    if not get_setting('TIMELINE_IMPORT_ACTIONS_ON_FOLLOW'):
        return


    import_actions.delay(to_uid=app.backend.get_uid(from_instance),
                         from_uid=app.backend.get_uid(to_instance))


@receiver(unfollowed)
def handle_unfollow(sender, from_instance, to_instance, *args, **kwargs):

    if not get_setting('TIMELINE_REMOVE_ACTIONS_ON_UNFOLLOW'):