Make public file or folder private (delete public url)
10899
def unpublish(self, path):
        """"""
        
        data = """
<propertyupdate xmlns="DAV:">
  <remove>
    <prop>
      <public_url xmlns="urn:yandex:disk:meta" />
    </prop>
  </remove>
</propertyupdate>
        """
        
        _check_dst_absolute(path)
        resp = self._sendRequest("PROPPATCH", addUrl=path, data=data)
        if resp.status_code == 207:
            pass
        else:
            raise YaDiskException(resp.status_code, resp.content)
1244690
def delete_file(self, secure_data_path):
        """"""
        secret_resp = delete_with_retry(self.cerberus_url + '/v1/secure-file/' + secure_data_path,
                                      headers=self.HEADERS)
        throw_if_bad_response(secret_resp)
        return secret_resp
1351427
def revoke_access(self):
        """"""
        reading = PERMISSIONS['user']['execute'] + PERMISSIONS['group']['execute'] + PERMISSIONS['other']['execute']
        os.chmod(self.file_path, reading)
407691
def sanitize_path(path):
    """"""

    storage_option = infer_storage_options(path)

    protocol = storage_option['protocol']
    if protocol in ('http', 'https'):
        # Most FSs remove the protocol but not HTTPFS. We need to strip
        # it to match properly.
        path = os.path.normpath(path.replace("{}://".format(protocol), ''))
    elif protocol == 'file':
        # Remove trailing slashes from file paths.
        path = os.path.normpath(path)
        # Remove colons
        path = path.replace(':', '')
    # Otherwise we just make sure that path is posix
    return make_path_posix(path)
316028
def dispose(self):
        """"""
        self._username = None
        self._password = None
        self._org_url = None
        self._proxy_url = None
        self._proxy_port = None
        self._token_url = None
        self._securityHandler = None
        self._valid = None
        self._message = None

        del self._username
        del self._password
        del self._org_url
        del self._proxy_url
        del self._proxy_port
        del self._token_url
        del self._securityHandler
        del self._valid
        del self._message
1289815
def get_private_and_public(username, password_verifier, private, preset):
    """"""
    session = SRPServerSession(
        SRPContext(username, prime=preset[0], generator=preset[1]),
        hex_from_b64(password_verifier), private=private)

    click.secho('Server private: %s' % session.private_b64)
    click.secho('Server public: %s' % session.public_b64)
591110
def delete(self):
        """"""
        self.close()
        if self.does_file_exist():
            os.remove(self.path)
1027857
def filter_directories(self):
        """"""
        index = self.get_index('.spyproject')
        if index is not None:
            self.setRowHidden(index.row(), index.parent(), True)
1143350
def createHiddenFolder(self) -> 'File':
        

        if not self._autoDelete:
            raise Exception("Hidden folders can only be created within"
                            " an autoDelete directory")
        return tempfile.mkdtemp(dir=self._path, prefix=".")
1278976
def key_file_private(self):
        '''
        '''
        if not hasattr(self, '_key_file_private'):
            self.key_file_private = '~/.ssh/{key}'.format(key=self.key_name)
        return self._key_file_private
895184
def destroy(self, url, recursive=False):
        """"""
        bucket, obj_key = _parse_url(url)

        if not bucket:
            raise InvalidURL(url,
                             "You must specify a bucket and (optional) path")

        if obj_key:
            target = "/".join((bucket, obj_key))
        else:
            target = bucket

        if recursive:
            for obj in self.get(url, delimiter=''):
                self.destroy(obj['url'])

        return self.call("DeleteBucket", bucket=target)
870579
def secret_file(filename):
    """"""
    filestat = os.stat(abspath(filename))
    if stat.S_ISREG(filestat.st_mode) == 0 and \
       stat.S_ISLNK(filestat.st_mode) == 0:
        e_msg = "Secret file %s must be a real file or symlink" % filename
        raise aomi.exceptions.AomiFile(e_msg)

    if platform.system() != "Windows":
        if filestat.st_mode & stat.S_IROTH or \
           filestat.st_mode & stat.S_IWOTH or \
           filestat.st_mode & stat.S_IWGRP:
            e_msg = "Secret file %s has too loose permissions" % filename
            raise aomi.exceptions.AomiFile(e_msg)
1224048
def delete_file(path)
      Jekyll.logger.debug "DELETING:", path
      FileUtils.rm_f sanitized_path(path)
      site.process
    end
62973
def conceal_member(self, login):
        
        url = self._build_url('public_members', login, base_url=self._api)
        return self._boolean(self._delete(url), 204, 404)
200035
def public(self, boolean):
        """"""
        if(boolean):
            r = self.flag({
                "flag": "make_public"
            })
        else:
            r = self.flag({
                "flag": "make_private"
            })

        return r
464474
def set_uri(self, uri):
        '''
        
        '''
        publicObj = self.get_public()
        if publicObj is not None:
            publicObj.set_uri(uri)
        else:
            publicObj = Cpublic()
            publicObj.set_uri(uri)
            self.set_public(publicObj)
443872
def url_or_file_open(uri):
    """"""
    if (not re.match(r'''\w+:''', uri)):
        uri = 'file:' + uri
    return(urlopen(uri))