'Outgoing pull
@param task: the task (sync_task Row)'

def pull(self, task, onconflict=None):

    repository = self.repository
    log = repository.log
    PATH = os.path.join(current.request.folder, 'uploads', 'adashi_feeds')
    try:
        files_list = os.listdir(PATH)
    except os.error:
        message = 'Upload    path    does    not    exist    or    can    not    be    accessed'
        log.write(repository_id=repository.id, resource_name='mixed', transmission=log.IN, mode=log.PUSH, action=('read    files    from    %s' % PATH), remote=False, result=log.FATAL, message=message)
        return (message, None)
    files = [os.path.join(PATH, f) for f in files_list if (f[(-4):] == '.xml')]
    files = filter(os.path.isfile, files)
    files.sort(key=os.path.getmtime)
    from ..s3import import S3ImportItem
    default_update_policy = S3ImportItem.POLICY.NEWER
    default_conflict_policy = S3ImportItem.POLICY.MASTER
    strategy = task.strategy
    update_policy = (task.update_policy or default_update_policy)
    conflict_policy = (task.conflict_policy or default_conflict_policy)
    if (update_policy not in ('THIS', 'OTHER')):
        last_sync = task.last_pull
    for f in files:
        current.log.debug(('ADASHI    Sync:    importing    %s' % f))
        try:
            with open(f, 'r') as source:
                result = self.receive([source], None, strategy=strategy, update_policy=update_policy, conflict_policy=conflict_policy, onconflict=onconflict, last_sync=last_sync, mixed=True)
        except IOError:
            continue
        log.write(repository_id=repository.id, resource_name='mixed', transmission=log.IN, mode=log.PUSH, action=('import    %s' % f), remote=result['remote'], result=result['status'], message=result['message'])
        try:
            os.remove(f)
        except os.error:
            current.log.error(('ADASHI    Sync:    can    not    delete    %s' % f))
    return (None, current.request.utcnow)
