Change path prefix and include app name.
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)
206135
def rename_with_prefix(self, prefix="", new_path=None, in_place=True, remove_desc=True):
        """"""
        # Temporary path #
        if new_path is None: prefixed = self.__class__(new_temp_path())
        else:                prefixed = self.__class__(new_path)
        # Generator #
        def prefixed_iterator():
            for i,read in enumerate(self):
                read.id = prefix + read.id
                if remove_desc: read.description = ""
                yield read
        # Do it #
        prefixed.write(prefixed_iterator())
        prefixed.close()
        # Replace it #
        if in_place:
            os.remove(self.path)
            shutil.move(prefixed, self.path)
        return prefixed
584842
def bind_path(self, name, folder):
        """"""
        if not len(name) or name[0] != '/' or name[-1] != '/':
            raise ValueError(
                "name must start and end with '/': {0}".format(name))
        self._folder_masks.insert(0, (name, folder))
972357
function replacePath (path, keys) {
  var index = 0;

  function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
    if (escaped) {
      return escaped;
    }

    if (escape) {
      return '\\' + escape;
    }

    var repeat   = suffix === '+' || suffix === '*';
    var optional = suffix === '?' || suffix === '*';

    keys.push({
      name:      key || index++,
      delimiter: prefix || '/',
      optional:  optional,
      repeat:    repeat
    });

    prefix = prefix ? ('\\' + prefix) : '';
    capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');

    if (repeat) {
      capture = capture + '(?:' + prefix + capture + ')*';
    }

    if (optional) {
      return '(?:' + prefix + '(' + capture + '))?';
    }

    // Basic parameter support.
    return prefix + '(' + capture + ')';
  }

  return path.replace(PATH_REGEXP, replace);
}
940047
def rename(self, dest_path: str):
        '''
        
        '''
        if not isinstance(dest_path, str):
            raise TypeError
        os.rename(self._path, dest_path)
        self._path = Path(dest_path).get_abspath()
1276953
def build_index_name(app, *parts):
    
    base_index = os.path.splitext(
        '-'.join([part for part in parts if part])
    )[0]

    return prefix_index(app=app, index=base_index)
370258
def format_application_name(name)
      if(name.index('.') != 0)
        name = '.' + name
      end
      return name.split(" ").join("_").downcase
    end
410694
def insert_system_path(opts, paths):
    '''
    
    '''
    if isinstance(paths, six.string_types):
        paths = [paths]
    for path in paths:
        path_options = {'path': path, 'root_dir': opts['root_dir']}
        prepend_root_dir(path_options, path_options)
        if (os.path.isdir(path_options['path'])
                and path_options['path'] not in sys.path):
            sys.path.insert(0, path_options['path'])
770283
def _include_paths_from_environ(env_prefix=''):
    """"""
    paths = os.environ.get(env_prefix + 'WSGI_AUTH_PATHS')
    if not paths:
        return []
    return paths.split(';')
783762
def _get_app_path(url):
    ''' 

    '''
    app_path = urlparse(url).path.rstrip("/")
    if not app_path.startswith("/"):
        app_path = "/" + app_path
    return app_path
297218
protected function setAppConfigNamespaces()
    {
        $search = [
            $this->currentRoot.'\\Providers',
            $this->currentRoot.'\\Http\\Controllers\\',
        ];

        $replace = [
            $this->argument('name').'\\Providers',
            $this->argument('name').'\\Http\\Controllers\\',
        ];

        $this->replaceIn($this->getConfigPath('app'), $search, $replace);
    }
47934
function resolve(path, config) {
    var original = path;

    if (/^([0-9a-z_$]+(\.[0-9a-z_$]+)*)$/gi.test(path))
        path = path.replace(/\./gi, '/') + '.js';

    var libs = config.getLibs();
    var appRoot = config.getBasePath();
    var appCodeDir = config.getAppDir();

    for(var prefix in libs) if (libs.hasOwnProperty(prefix)) {
        if (path.substr(0, prefix.length) == prefix) {
            path = libs[prefix] + path.substring(prefix.length);
            break;
        }
    }

    path = path.replace(/^~\//gi, appRoot);
    path = path.replace(/^\.\//gi, appCodeDir);

    if (!path.match(/^\//i) && !path.match(/^\w:\\/))
        path = appCodeDir + path;

    path = path.replace(/\/\//gi, '/');

    return path;
}
1357334
def setup_prefix_suffix(self):
        

        self.compile_prefix = 'compile_'
        self.sourcepath_suffix = '_sourcepath'
        self.modpath_suffix = '_modpaths'
        self.targetpath_suffix = '_targetpaths'
1016265
def add_static_path(prefix: str, path: str, no_watch: bool = False) -> None:
    
    app = get_app()
    app.add_static_path(prefix, path)
    if not no_watch:
        watch_dir(path)
1353385
function (root_path, default_prefix) {
		var arr = SR.Settings.SR_PATH.split(SR.path.sep);
		var prefix = arr[arr.length-1] + '-';
		var dirs = UTIL.getDirectoriesSync(root_path);

		if (default_prefix)
			prefix = default_prefix;
		
		//LOG.warn('default_prefix: ' + default_prefix + ' prefix: ' + prefix + ' paths to check:');
		for (var i in dirs) {
			//LOG.warn(dirs[i]);
			if (dirs[i].startsWith(prefix)) { 
				SR.Settings.MOD_PATHS.push(SR.path.resolve(root_path, dirs[i]));
			}
		}
	}
134072
def add_suffix(path, suffix=""):
    """"""
    return join(dirname(path), basename(path, ext=False) + suffix + extname(path))
59505
function formatPath(pattern, path) {
    let prefix = pattern.replace(/(\/\*\*|\/\*)/g, '');
    return path.replace(prefix, '').replace(/(\/[a-zA-Z-_]+)/, '$1' + prefix);
  }