Update file path.
338108
private function updateWebResourceFilePath()
    {
        $this->log('Update resourceWeb file path ...');

        /** @var ObjectManager $om */
        $om = $this->container->get('claroline.persistence.object_manager');
        $resourceType = $om->getRepository('Claroline\CoreBundle\Entity\Resource\ResourceType')->findOneBy(['name' => 'claroline_web_resource']);
        $resourceNodes = $om->getRepository('Claroline\CoreBundle\Entity\Resource\ResourceNode')->findBy(['resourceType' => $resourceType]);
        $resourceManager = $this->container->get('claroline.manager.resource_manager');
        $fs = $this->container->get('filesystem');

        foreach ($resourceNodes as $resourceNode) {
            $file = $resourceManager->getResourceFromNode($resourceNode);
            $workspace = $resourceNode->getWorkspace();

            if (!empty($file)) {
                $hash = $file->getHashName();
                $uploadDir = $this->container->getParameter('claroline.param.uploads_directory');
                $filesDir = $this->container->getParameter('claroline.param.files_directory');

                if ($fs->exists($filesDir.DIRECTORY_SEPARATOR.$hash)) {
                    $fs->copy($filesDir.DIRECTORY_SEPARATOR.$hash, $filesDir.DIRECTORY_SEPARATOR.'webresource'.DIRECTORY_SEPARATOR.$workspace->getUuid().DIRECTORY_SEPARATOR.$hash);
                    $fs->remove($filesDir.DIRECTORY_SEPARATOR.$hash);
                }

                if ($fs->exists($uploadDir.DIRECTORY_SEPARATOR.$hash)) {
                    $fs->mirror($uploadDir.DIRECTORY_SEPARATOR.$hash, $uploadDir.DIRECTORY_SEPARATOR.'webresource'.DIRECTORY_SEPARATOR.$workspace->getUuid().DIRECTORY_SEPARATOR.$hash);
                    $fs->remove($uploadDir.DIRECTORY_SEPARATOR.$hash);
                }
            }
        }
    }
683353
def _expand_path(path):
    """"""
    path = os.path.expandvars(path)
    path = os.path.expanduser(path)
    return path
1273272
private function updateVersionInFile()
  {
    if ($this->myFilename)
    {
      $status = file_put_contents($this->myFilename, $this->myNewVersion['version']);
      if (!$status)
      {
        $this->logError("File %s is not writable", $this->myFilename);
      }
    }
  }
733641
def update(self):
        """"""
        pids = fileops.readlines(self.paths['cgroup.procs'])
        self.pids = [int(pid) for pid in pids if pid != '']
        self.n_procs = len(pids)
330614
def update_environment(lib_directory):
        """"""
        # Use this if you want to include modules from a subfolder
        # lib_path = os.path.realpath(
        #     os.path.abspath(
        #         os.path.join(
        #             os.path.split(inspect.getfile(inspect.currentframe()))[0], lib_directory)))
        lib_path = os.path.join(os.getcwd(), lib_directory)
        if 'PYTHONPATH' in os.environ:
            os.environ['PYTHONPATH'] = '{}{}{}'.format(
                lib_path, os.pathsep, os.environ['PYTHONPATH']
            )
        else:
            os.environ['PYTHONPATH'] = '{}'.format(lib_path)
335762
def change_path_prefix(self, path, old_prefix, new_prefix, app_name):
        """"""
        relative_path = os.path.relpath(path, old_prefix)
        return os.path.join(new_prefix, app_name, relative_path)
26502
protected function updateFilenames(): void
    {
        $this->files->setFlags(\FilesystemIterator::KEY_AS_FILENAME
            | \FilesystemIterator::CURRENT_AS_FILEINFO
            | \FilesystemIterator::SKIP_DOTS);
        $this->filenames = array_keys(iterator_to_array($this->files));
    }
67629
def expand_path(*paths):
    """"""
    return os.path.join(
        os.path.dirname(os.path.realpath(sys.argv[0])), *paths)
33855
def update(self):
        """"""
        if not os.path.isdir(os.path.join(self.path)):
            os.makedirs(self.path)
        if not os.path.isdir(os.path.join(self.path, 'refs')):
            subprocess.check_output([
                'git', 'clone', '--bare', self.repo_git, self.path
            ])
        self.run(['gc', '--auto', '--prune=all'])
        self.run(['fetch', '-p', 'origin', '+refs/heads/*:refs/heads/*'])
        # github support
        self.run(['fetch', 'origin', '+refs/pull/*/head:refs/pull/*'])
        # gitlab support
        self.run([
            'fetch', 'origin', '+refs/merge-requests/*/head:refs/pull/*'])
490039
def _fixpath(self, p):
        """"""
        return os.path.abspath(os.path.expanduser(p))
1294854
public function update()
    {
        if (!file_exists(static::FILENAME)) {
            return;
        }

        $contents = Yaml::parse(file_get_contents(static::FILENAME)) ?: [];

        if (!isset($contents['paths'])) {
            return;
        }

        $originalPaths = $contents['paths'];
        $contents['paths'] = $newPaths = $this->updatePaths(new MutableBag($originalPaths))->toArray();

        if ($originalPaths === $newPaths) {
            return;
        }

        $this->save($contents);
    }
345543
def update_file(finfo, sample_info, config):
    
    if GalaxyInstance is None:
        raise ImportError("Could not import bioblend.galaxy")
    if "dir" not in config:
        raise ValueError("Galaxy upload requires `dir` parameter in config specifying the "
                         "shared filesystem path to move files to.")
    if "outputs" in config:
        _galaxy_tool_copy(finfo, config["outputs"])
    else:
        _galaxy_library_upload(finfo, sample_info, config)
72940
def set_path(self, path):
		""""""
		if os.path.isabs(path):
			path = os.path.normpath(os.path.join(self.cwd, path))

		self.path = path
		self.relative = os.path.relpath(self.path, self.base)
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])
        )
781630
def walk_up_dirs(path):
    """"""
    prev_path = None
    current_path = os.path.abspath(path)
    while current_path != prev_path:
        yield current_path
        prev_path = current_path
        current_path = os.path.dirname(prev_path)
615122
def _patch_file(path, content):
    """"""
    f = open(path)
    existing_content = f.read()
    f.close()
    if existing_content == content:
        # already patched
        log.warn('Already patched.')
        return False
    log.warn('Patching...')
    _rename_path(path)
    f = open(path, 'w')
    try:
        f.write(content)
    finally:
        f.close()
    return True
972690
def addpath(path):
    """"""
    import sys
    if not exists(path):
        raise ValueError('Path %s does not exist' % path)
    sys.path.insert(1, path)