Did I find the right examples for you? yes no

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)

        def iswritable(path):
    """Returns True if the path can be written to or created."""
    return ((os.path.exists(path) and os.access(path, os.W_OK))
            or os.access(os.path.dirname(path), os.W_OK))
        


src/a/s/astropy-0.3.1/astropy/io/fits/file.py   astropy(Download)
from numpy import memmap as Memmap
 
from .util import (isreadable, iswritable, isfile, fileobj_open, fileobj_name,
                   fileobj_closed, fileobj_mode, _array_from_file,
                   _array_to_file, _write_string, encode_ascii)
    def writable(self):
        if self.readonly:
            return False
        return iswritable(self.__file)
 

src/a/s/astropy-0.3.1/astropy/io/fits/py3compat.py   astropy(Download)
    util.isreadable = isreadable
 
    from .util import iswritable as _iswritable
 
    def iswritable(f):
        if hasattr(f, 'writable'):
            return f.writable()
        return _iswritable(f)

src/p/y/python-future-HEAD/docs/3rd-party-py3k-compat-code/astropy_py3compat.py   python-future(Download)
    util.isreadable = isreadable
 
    from .util import iswritable as _iswritable
 
    def iswritable(f):
        if hasattr(f, 'writable'):
            return f.writable()
        return _iswritable(f)

src/f/r/frescobaldi-HEAD/frescobaldi_app/mainwindow.py   frescobaldi(Download)
        if not filename:
            dest = doc.url().toString()
        if not util.iswritable(filename):
            QMessageBox.warning(self, app.caption(_("Error")),
                _("Can't write to destination:\n\n{url}").format(url=dest))
        if not filename:
            return False # cancelled
        if not util.iswritable(filename):
            QMessageBox.warning(self, app.caption(_("Error")),
                _("Can't write to destination:\n\n{url}").format(url=filename))