Update RelativeDir.
333864
public function onVichUploaderPostUpload(Event $event)
    {
        $object = $event->getObject();
        $mapping = $event->getMapping();

        $absoluteDir = $mapping->getUploadDestination().'/'.$mapping->getUploadDir($object);
        $relativeDir = substr_replace($absoluteDir, '', 0, strlen($this->projectDir) + 1);

        $object->setRelativeDir($relativeDir);

        if (false !== strpos($object->getMimeType(), 'image/')) {
            $img = $mapping->getUploadDestination().'/'.$mapping->getUploadDir($object).'/'.$object->getMedia();
            $palette = Palette::fromFilename($img, Color::fromHexToInt('#FFFFFF'));
            $extractor = new ColorExtractor($palette);
            $colors = $extractor->extract();
            $object->setMainColor(Color::fromIntToHex($colors[0]));

            $this->generateCache('/'.$relativeDir.'/'.$object->getMedia());
        }
    }
921649
def _update(self, kwargs):
        """"""
        from pygal.util import merge
        dir_self_set = set(dir(self))
        merge(
            self.__dict__,
            dict([(k, v) for (k, v) in kwargs.items()
                  if not k.startswith('_') and k in dir_self_set])
        )
467725
def rmdir(self, req, parent, name):
        
        self.reply_err(req, errno.EROFS)
181952
def update(self, id):
        """"""
        map = self._get_map_from_user_by_id(c.user, id)
        if map is None:
            abort(404)

        # get json content from PUT request
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        #content = content.decode('utf8')

        # update mapfile
        mapfile = Mapfile()
        dict = simplejson.loads(content)
        mapfile.from_dict(dict)
        mapfile.to_file(os.path.join(config['mapfiles_dir'], map.filepath))
        if mapfile.get_name() != map.name:
            self._update_map(map, name=mapfile.get_name())

        response.status = 201
        return
1040677
def up_by_files(to_sync, remote_dir=DEFAULT_REMOTE_DIR, remote_files=None):
    """"""
    if remote_files is None:
        remote_files = command.map_files_raw(remote_dir=remote_dir)
    for local_file in to_sync:
        _sync_local_file(local_file, remote_dir, remote_files)
973466
private function renameDirectories(): void
    {
        //update directory names and update file created paths accordingly
        foreach ($this->dirsToRename as $dirPath) {
            $updateDirPath = $this->pathHelper->renamePathBasenameSingularOrPlural(
                $dirPath,
                $this->singularNamespacedName,
                $this->pluralNamespacedName
            );
            foreach ($this->filesCreated as $k => $filePath) {
                $this->filesCreated[$k] = \str_replace($dirPath, $updateDirPath, $filePath);
            }
        }
    }
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()
1144230
def excursion(directory):
    """"""
    old_dir = os.getcwd()
    try:
        os.chdir(directory)
        yield
    finally:
        os.chdir(old_dir)
374863
def upgrade(directory, sql, tag, x_arg, revision):
    """"""
    _upgrade(directory, revision, sql, tag, x_arg)
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
208617
def update(self, *others):
        """"""
        self.db.sunionstore(self.key, [self.key] + [o.key for o in others])
755344
def mkdirp(kls, path, mode=0o755):
		""""""
		os.makedirs(path, mode=mode, exist_ok=True)
746932
def make_relative(base, obj):
    """"""
    uri = obj.get("location", obj.get("path"))
    if ":" in uri.split("/")[0] and not uri.startswith("file://"):
        pass
    else:
        if uri.startswith("file://"):
            uri = uri_file_path(uri)
            obj["location"] = os.path.relpath(uri, base)
918864
def replace_in_dirs(version):
    """"""
    print(color(
        "Upgrading directory-components dependency in all repos...",
        fg='blue', style='bold'))
    for dirname in Utils.dirs:
        replace = "directory-components=={}".format(version)
        replace_in_files(dirname, replace)
    done(version)
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
360200
def do_mkdir(self, path):
        """"""
        path = path[0]

        self.n.makeDirectory(self.current_path + path)
        self.dirs = self.dir_complete()
586501
def select_directory(self, edit):
        """"""
        basedir = to_text_string(edit.text())
        if not osp.isdir(basedir):
            basedir = getcwd_or_home()
        title = _("")
        directory = getexistingdirectory(self, title, basedir)
        if directory:
            edit.setText(directory)