Updates the directory listing from the client.

    Args:
      path: The path to the directory to update. Client is inferred from this.
      fh: A file handler. Not used.

    Returns:
      A list of filenames.
15704
def Readdir(self, path, fh=None):
    
    if self.DataRefreshRequired(path):
      self._RunAndWaitForVFSFileUpdate(path)

    return super(GRRFuse, self).Readdir(path, fh=None)
1238124
def __update_cleanup_paths(new_path):
    
    cleanup_dirs = settings.CFG["cleanup_paths"].value
    cleanup_dirs = set(cleanup_dirs)
    cleanup_dirs.add(new_path)
    cleanup_dirs = list(cleanup_dirs)
    settings.CFG["cleanup_paths"] = cleanup_dirs
935482
def update(target, path, value):
    
    names = path.split(".")
    names_length = len(names)
    node = target
    for index in range(names_length):
        name = names[index]
        if index == names_length - 1:
            last = True
        else:
            last = False
        if isinstance(node, dict):
            if last:
                node[name] = value
                return
            else:
                if not name in node:
                    node[name] = {}
                node = node[name]
        elif isinstance(node, list):
            name = int(name)
            listpad(node, name+1)
            if last:
                node[name] = value
                return
            else:
                node[name] = {}
                node = node[name]
        else:
            if last:
                setattr(node, name, value)
            else:
                setattr(node, name, {})
                node = getattr(node, name)
421263
def _RunAndWaitForVFSFileUpdate(self, path):
    """"""

    client_id = rdf_client.GetClientURNFromPath(path)

    # If we're not actually in a directory on a client, no need to run a flow.
    if client_id is None:
      return

    flow_utils.UpdateVFSFileAndWait(
        client_id,
        token=self.token,
        vfs_file_urn=self.root.Add(path),
        timeout=self.timeout)
597686
def set_path(self, path):
        ''''''
        self._path = path
        return self._listitem.setPath(path)
673149
def update_paths(self):
        
        new_paths = []
        with self.lock:
            for path in expand_source_paths(iter_module_paths()):
                if path not in self.paths:
                    self.paths.add(path)
                    new_paths.append(path)
        if new_paths:
            self.watch_paths(new_paths)
288714
def listdir(self, path):
        
        bucket, obj = self._path_to_bucket_and_key(path)

        obj_prefix = self._add_path_delimiter(obj)
        if self._is_root(obj_prefix):
            obj_prefix = ''

        obj_prefix_len = len(obj_prefix)
        for it in self._list_iter(bucket, obj_prefix):
            yield self._add_path_delimiter(path) + it['name'][obj_prefix_len:]
171430
def mkdir(path)
      path = @uri.merge(path).path
      res = @handler.request(:mkcol, path, nil, @headers)
      res.body
    end
953334
def release(self, path, fh):
        ""
        #print "release! inpath:", path in self.__newfiles.keys()
        # if the path exists in self.__newfiles.keys(), we have a new version to upload
        try:
            f = self.__newfiles[path] # make a local shortcut to Stringio object
            f.seek(0, os.SEEK_END)
            if f.tell() > 0: # file has length
                self.client.up(path, f) # upload to jottacloud
            del self.__newfiles[path]
            del f
            self._dirty(path)
        except KeyError:
            pass
        return ESUCCESS
232452
def update_files paths, matcher, currentVersion, nextVersion
      paths.each do |path|
        update_file path, matcher, currentVersion, nextVersion
      end
    end
504077
def _SetPath(self, path):
    
    old_path = self._path
    if old_path and not io_wrapper.IsCloudPath(old_path):
      try:
        # We're done with the path, so store its size.
        size = tf.io.gfile.stat(old_path).length
        logger.debug('Setting latest size of %s to %d', old_path, size)
        self._finalized_sizes[old_path] = size
      except tf.errors.OpError as e:
        logger.error('Unable to get size of %s: %s', old_path, e)

    self._path = path
    self._loader = self._loader_factory(path)
749720
def get_files(self, path):
        

        if os.path.isfile(path):
            self.logger.debug('Called with single file as target: {0}'.format(path))
            yield path
            return

        self.logger.debug('Getting list of files in {0}'.format(path))

        try:
            for f in os.listdir(path):
                cur_file = os.path.join(path, f)
                if f[0] != '.' and os.path.isfile(cur_file):
                    yield cur_file
        except OSError:
            self.logger.error('Could not read files from {0}'.format(path))
            raise
705955
def add_path(self, path):
        

        if os.path.exists(path):
            self.paths.add(path)
            return path
        else:
            #logger.debug('Path {} doesn\'t exist'.format(path))
            return None
438641
def _serve_file(self, path):
        
        static = PkgResourcesParser('pylons', 'pylons')
        request.environ['PATH_INFO'] = '/%s' % path
        return static(request.environ, self.start_response)
220115
def update_path(self):
        
        if WINDOWS:
            return self.add_to_windows_path()

        # Updating any profile we can on UNIX systems
        export_string = self.get_export_string()

        addition = "\n{}\n".format(export_string)

        updated = []
        profiles = self.get_unix_profiles()
        for profile in profiles:
            if not os.path.exists(profile):
                continue

            with open(profile, "r") as f:
                content = f.read()

            if addition not in content:
                with open(profile, "a") as f:
                    f.write(addition)

                updated.append(os.path.relpath(profile, HOME))
1293736
def initiate_upgrade_connection(self, headers, path):
        # type: (List[Tuple[bytes, bytes]], str) -> None
        
        if self.client:
            raise LocalProtocolError(
                "Cannot initiate an upgrade connection when acting as the client"
            )
        upgrade_request = h11.Request(method=b"GET", target=path, headers=headers)
        h11_client = h11.Connection(h11.CLIENT)
        self.receive_data(h11_client.send(upgrade_request))
143495
def _path_with_dir_fd(self, path, fct, dir_fd):
        """"""
        if dir_fd is not None:
            if sys.version_info < (3, 3):
                raise TypeError("%s() got an unexpected keyword "
                                "argument 'dir_fd'" % fct.__name__)
            # check if fd is supported for the built-in real function
            real_fct = getattr(os, fct.__name__)
            if real_fct not in self.supports_dir_fd:
                raise NotImplementedError(
                    'dir_fd unavailable on this platform')
            if isinstance(path, int):
                raise ValueError("%s: Can't specify dir_fd without "
                                 "matching path" % fct.__name__)
            if not self.path.isabs(path):
                return self.path.join(
                    self.filesystem.get_open_file(
                        dir_fd).get_object().path, path)
        return path