'Constructor
@param repository: the repository record (Row)'

def __init__(self, repository):

    self.log = S3SyncLog
    self._config = None
    self.id = repository.id
    self.name = repository.name
    self.apitype = repository.apitype
    self.backend = repository.backend
    self.url = repository.url
    self.path = repository.path
    self.username = repository.username
    self.password = repository.password
    self.client_id = repository.client_id
    self.client_secret = repository.client_secret
    self.site_key = repository.site_key
    self.refresh_token = repository.refresh_token
    self.proxy = repository.proxy
    self.synchronise_uuids = repository.synchronise_uuids
    self.keep_source = repository.keep_source
    import sync_adapter
    api = sync_adapter.__dict__.get(self.apitype)
    if api:
        adapter = api.S3SyncAdapter(self)
    else:
        adapter = S3SyncBaseAdapter(self)
    self.adapter = adapter
