Python os.path.setter() Examples

The following are code examples for showing how to use os.path.setter(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def path(self, val):
            from baiji.util.munging import _strip_initial_slashes
            self._path = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init
            # For remote operations, we need a path without initial slashes
            self.remote_path = _strip_initial_slashes(self.path) 
Example 2
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def policy(self, val):
        if val and self.dst.is_file:
            raise ValueError("Policy only allowed when copying to s3")
        self._policy = val  # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 3
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def version_id(self, val):
        self._version_id = val  # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 4
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def preserve_acl(self, val):
        val = bool(val)
        if val and self.task != ('s3', 's3'):
            raise ValueError("Preserve ACL only allowed when copying from s3 to s3")
        self._preserve_acl = val  # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 5
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def progress(self, val):
        val = bool(val)
        self._progress = val  # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 6
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def skip(self, val):
        val = bool(val)
        self._skip_exist = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 7
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def encrypt(self, val):
        val = bool(val) and self.dst.is_s3
        self._encrypt = val  # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 8
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def validate(self, val):
        self._validate = bool(val) # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 9
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def encoding(self, val):
        if val is not None and self.dst.is_file:
            raise ValueError("Encoding can only be specified when copying to s3")
        if val is not None and self.gzip and val != 'gzip':
            raise ValueError("gzip overrides explicit encoding")
        self._encoding = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 10
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def gzip(self, val):
        val = bool(val)
        if val and self.task != ('file', 's3'):
            raise ValueError("gzip can only be specified when uploading to s3")
        if val and self.encoding is not None and self.encoding != 'gzip':
            raise ValueError("gzip overrides explicit encoding")
        self._gzip = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 11
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def content_type(self, val):
        if val is not None and self.dst.is_file:
            raise ValueError("Content Type can only be specified when copying to s3")
        self._content_type = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init 
Example 12
Project: baiji   Author: bodylabs   File: copy.py    (license) View Source Project 5 votes vote down vote up
def metadata(self, val):
        if not (val is None or val == {}) and self.dst.is_file:
            raise ValueError("Metadata can only be specified when copying to s3")
        if val is None:
            val = {}
        self._metadata = val # we get initialized with a call to the setter in init pylint: disable=attribute-defined-outside-init