Update folder.

        Updates a folder
2177
def update_folder(self, id, hidden=None, lock_at=None, locked=None, name=None, parent_folder_id=None, position=None, unlock_at=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # OPTIONAL - name
        """The new name of the folder"""
        if name is not None:
            data["name"] = name

        # OPTIONAL - parent_folder_id
        """The id of the folder to move this folder into. The new folder must be in the same context as the original parent folder."""
        if parent_folder_id is not None:
            data["parent_folder_id"] = parent_folder_id

        # OPTIONAL - lock_at
        """The datetime to lock the folder at"""
        if lock_at is not None:
            data["lock_at"] = lock_at

        # OPTIONAL - unlock_at
        """The datetime to unlock the folder at"""
        if unlock_at is not None:
            data["unlock_at"] = unlock_at

        # OPTIONAL - locked
        """Flag the folder as locked"""
        if locked is not None:
            data["locked"] = locked

        # OPTIONAL - hidden
        """Flag the folder as hidden"""
        if hidden is not None:
            data["hidden"] = hidden

        # OPTIONAL - position
        """Set an explicit sort position for the folder"""
        if position is not None:
            data["position"] = position

        self.logger.debug("PUT /api/v1/folders/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("PUT", "/api/v1/folders/{id}".format(**path), data=data, params=params, single_item=True)
241646
def update_folder_name(self, name, update_folder_data=True):
        
        if self.root:
            return False
        if not name:
            return False

        url = self.build_url(
            self._endpoints.get('get_folder').format(id=self.folder_id))

        response = self.con.patch(url, data={self._cc('displayName'): name})
        if not response:
            return False

        self.name = name
        if not update_folder_data:
            return True

        folder = response.json()

        self.name = folder.get(self._cc('displayName'), '')
        self.parent_id = folder.get(self._cc('parentFolderId'), None)
        self.child_folders_count = folder.get(self._cc('childFolderCount'), 0)
        self.unread_items_count = folder.get(self._cc('unreadItemCount'), 0)
        self.total_items_count = folder.get(self._cc('totalItemCount'), 0)
        self.updated_at = dt.datetime.now()

        return True
622378
def updateFromArchivePage(self, archiveRoot, names, files, parent = "/", verbose=False):
		""""""
		root = archiveRoot + parent
		archive = urllib.urlopen(root)
		archiveText = archive.read()
		archive.close()
				
		# Recursively call this function on all subdirectories
		working = archiveText
		folderString = 'solid #aaa;"><a href="index.php?mode=folder&path='
		while folderString in working:
			index = working.find(folderString) + len(folderString)
			folder = working[index:]
			folder = folder[:folder.find('>') - 1]
			working = working[index + len(folder):]
			if folder != "" and folder.count("/") > parent.count("/"):
				if verbose:
					self.printd("  Caching " + folder)
				self.updateFromArchivePage(archiveRoot, names, files, folder, verbose)
				
		# Now, step through all files and write them to the names and files objects
		working = archiveText
		fileString = "../scripts/countdown.php?" #/73/basic/games/aod73.zip&path=archives"
		while fileString in working:
			# Get the filename and path of the file
			index = working.find(fileString) + len(fileString)
			fileData = working[index:]
			fileData = fileData[:fileData.find("&path=archives")]
			
			# Get the proper name (title) of the file
			working = working[index:]
			nameData = working[working.find('1.25em;"><b>') + len('1.25em;"><b>'):]
			nameData = nameData[:nameData.find('</B>')]
			
			# Write files to index objects
			files.write(fileData + "\n")
			names.write(nameData + "\n")
894791
function update () {
      sourceOrOptions.bundle()
        .pipe(concat(function (data) {
          add(filepath, data.toString())
        }))
        .on('error', function (err) {
          console.error(err.stack)
          ASSET_PENDING--
        })
    }
720762
def update(self):
        """"""
        # Only continue if monitor list is not empty
        if len(self.__folder_list) == 0:
            return self.__folder_list

        # Iter upon the folder list
        for i in range(len(self.get())):
            # Update folder size
            try:
                self.__folder_list[i]['size'] = self.__folder_size(self.path(i))
            except OSError as e:
                logger.debug('Cannot get folder size ({}). Error: {}'.format(self.path(i), e))
                if e.errno == 13:
                    # Permission denied
                    self.__folder_list[i]['size'] = '!'
                else:
                    self.__folder_list[i]['size'] = '?'

        return self.__folder_list
959688
def save_version(folder: str):
        
        fname = os.path.join(folder, C.VERSION_NAME)
        with open(fname, "w") as out:
            out.write(__version__)
536392
function (folder, oldPath, newPath, callback) {
	var cb = callback || function () {};
	if (typeof newPath === 'function') {
		cb = newPath;
		newPath = oldPath.split( '/' ).pop();
	} else if (!newPath) {
		newPath = oldPath.split( '/' ).pop();
	}
	// check for valid arguments
	if (folder && oldPath && (typeof folder === 'string') && (typeof oldPath === 'string') && fs.existsSync( oldPath )) {
		// check for existing folder
		if (this.folders[folder]) {
			// set target
			newPath = path.resolve( this.folders[folder], newPath );
			newPath = checkSafeName.call( this, newPath );
			return {newPath: newPath, callback: cb};
		} else {
			cb( 'invalid folder' );
			return false;
		}
	} else {
		cb( 'folder or origin not valid' );
		return false;
	}
}
1035857
def refresh(self, new_path=None, force_current=False):
        """"""
        if new_path is None:
            new_path = getcwd_or_home()
        if force_current:
            index = self.set_current_folder(new_path)
            self.expand(index)
            self.setCurrentIndex(index)
        self.set_previous_enabled.emit(
                             self.histindex is not None and self.histindex > 0)
        self.set_next_enabled.emit(self.histindex is not None and \
                                   self.histindex < len(self.history)-1)
        # Disable the view of .spyproject. 
        self.filter_directories()
530762
function mkdirpSync(folder) {
  if (!fs.existsSync(path.dirname(folder))) {
    mkdirpSync(path.dirname(folder));
  }

  if (!fs.existsSync(folder)) {
    fs.mkdirSync(folder, '0755');
  }
}
353939
def update(self, path, verbose=False):
        
        if path in self._by_path:
            self.remove(path)
        else:
            self.add(path, verbose)
1280840
def set_dir(self, dir_):
        """"""

        self.__lock_set_dir(dir_)
        self.__lock_auto_load()
        self.__lock_update_table()
        self.__update_info()
        self.__update_window_title()
1128267
function _updateSingleton() {
    if (!options.singletons) {
      return;
    }
    if (process.rebusinstances[folder]) {
      // Somebody added instance already.
      return;
    }
    // Save this instance to return the same for the same folder.
    process.rebusinstances[folder] = instance;
  }
54898
public function update()
    {
        $this->setUpVersion();
        $connection = $this->getConnection();
        foreach ($this->folders as $name => $path) {
            $folder = new FolderImpl($path);
            if (!$folder->exists()) {
                continue;
            }
            /** @var File[] $files */
            $files = $folder->listFolder(Folder::LIST_FOLDER_FILES);

            usort($files, function (File $a, File $b) {
                return $this->leadingNumber($a->getFilename()) - $this->leadingNumber($b->getFilename());
            });
            $lastFile = null;
            $version = $this->getVersion($name);
            foreach ($files as $file) {
                if ($file->getExtension() != 'sql') {
                    continue;
                }

                if ($this->leadingNumber($file->getFilename()) <= $version) {
                    continue;
                }

                $stmt = $connection->prepare($file->getContents());
                $stmt->execute();

                while ($stmt->nextRowset()) ; //Polling row sets

                $lastFile = $file;
            }
            if ($lastFile == null) {
                continue;
            }
            $this->setVersion($name, $this->leadingNumber($lastFile->getFilename()));

        }
    }
485189
def update_metadata(self, key: str, msg: MaildirMessage) -> None:
        
        subpath = self._lookup(key)
        subdir, name = os.path.split(subpath)
        new_subdir = msg.get_subdir()
        new_name = key + self.colon + msg.get_info()
        if subdir != new_subdir:
            raise ValueError('Message subdir may not be updated')
        elif name != new_name:
            new_subpath = os.path.join(msg.get_subdir(), new_name)
            old_path = os.path.join(self._path, subpath)
            new_path = os.path.join(self._path, new_subpath)
            os.rename(old_path, new_path)
            self._toc[key] = new_subpath
496198
def update_if_outdated(folder):
    

    folders = []
    while os.path.isdir(folder):
        folders.append(folder)
        # Get info.yml
        with open(os.path.join(folder, "info.yml")) as ymlfile:
            content = yaml.load(ymlfile)
        folder = os.path.join(utils.get_project_root(), content['data-source'])
    raw_source_file = folder
    if not os.path.isfile(raw_source_file):
        logging.error("File '%s' was not found.", raw_source_file)
        logging.error("You should eventually execute 'hwrt download'.")
        sys.exit(-1)
    dt = os.path.getmtime(raw_source_file)
    source_mtime = datetime.datetime.utcfromtimestamp(dt)
    folders = folders[::-1]  # Reverse order to get the most "basic one first"

    for target_folder in folders:
        target_mtime = utils.get_latest_successful_run(target_folder)
        if target_mtime is None or source_mtime > target_mtime:
            # The source is later than the target. That means we need to
            # refresh the target
            if "preprocessed" in target_folder:
                logging.info("Preprocessed file was outdated. Update...")
                preprocess_dataset.main(os.path.join(utils.get_project_root(),
                                                     target_folder))
            elif "feature-files" in target_folder:
                logging.info("Feature file was outdated. Update...")
                create_ffiles.main(target_folder)
            elif "model" in target_folder:
                logging.info("Model file was outdated. Update...")
                create_model.main(target_folder, True)
            target_mtime = datetime.datetime.utcnow()
        else:
            logging.info("'%s' is up-to-date.", target_folder)
        source_mtime = target_mtime
1356632
def update(self):
        """"""
        self.filename = self.parent.info.dataset.filename

        self.chan = self.parent.info.dataset.header['chan_name']
        for chan in self.chan:
            self.idx_chan.addItem(chan)
675359
def update():
    '''
    
    '''
    try:
        salt.fileserver.reap_fileserver_cache_dir(
            os.path.join(__opts__['cachedir'], 'minionfs/hash'),
            find_file)
    except os.error:
        # Hash file won't exist if no files have yet been served up
        pass