Makes a subproduct filename by appending 'ext' to the subproduct directory.
        Returns a (filename,fullpath) tuple.
433749
def subproductPath(self, ext):
        """"""
        ext = ext.lstrip("-")
        basename = os.path.join(os.path.basename(self.dp.subproduct_dir()), ext)
        fullpath = os.path.join(self.dp.subproduct_dir(), ext)
        return basename, fullpath
842934
def remove_ext(fname):
    
    bn = os.path.basename(fname)
    return os.path.splitext(bn)[0]
713767
def split_extension(pathname):
        
        filepart = win32.PathRemoveExtension(pathname)
        extpart  = win32.PathFindExtension(pathname)
        return (filepart, extpart)
3331
def make_filenames(self, **kwargs):
        
        out_dict = dict(ft1file=self.ft1file(**kwargs),
                        ltcube=self.ltcube(**kwargs),
                        ccube=self.ccube(**kwargs),
                        bexpcube=self.bexpcube(**kwargs),
                        srcmaps=self.srcmaps(**kwargs),
                        mcube=self.mcube(**kwargs))
        return out_dict
662737
def get_ext(path_name, *, if_all_ext=False):
    
    if has_ext(path_name):
        return os.path.splitext(path_name)[EXTENSION]
    elif if_all_ext and has_ext(path_name, if_all_ext=True):
        return os.path.splitext(path_name)[NAME]
    else:
        return ''
981777
def subst_path(self, env, target, source):
        
        result = []
        for type, value in self.pathlist:
            if type == TYPE_STRING_SUBST:
                value = env.subst(value, target=target, source=source,
                                  conv=node_conv)
                if SCons.Util.is_Sequence(value):
                    result.extend(SCons.Util.flatten(value))
                elif value:
                    result.append(value)
            elif type == TYPE_OBJECT:
                value = node_conv(value)
                if value:
                    result.append(value)
            elif value:
                result.append(value)
        return tuple(result)
344230
def subproductUpToDate(self, fpath):
        """"""
        # subproduct is up-to-date if it is older than the file mtime
        if not os.path.exists(self.dp.subproduct_dir()):
            os.mkdir(self.dp.subproduct_dir())
        ## This caused many re-rendering whenever a plugin got recompiled, so I disabled it.
        ## Need to add a control for re-rendering.
        ##    if os.path.exists(fpath) and os.path.getmtime(fpath) >= max(self.file_mtime,self.module_mtime):
        if os.path.exists(fpath) and os.path.getmtime(fpath) >= self.file_mtime:
            dprintf(3, "subproduct %s is up-to-date, no need to regenerate\n", fpath)
            return True
        else:
            if not os.path.exists(fpath):
                dprintf(3, "subproduct %s does not yet exist, will generate\n", fpath)
            else:
                dprintf(4, "subproduct %s is out of date (timestamp %s, file %s, module %s), will regenerate\n", fpath,
                        time.strftime("%x %X", time.localtime(os.path.getmtime(fpath))),
                        time.strftime("%x %X", time.localtime(self.file_mtime)),
                        time.strftime("%x %X", time.localtime(self.module_mtime)))
            return False
199003
function (moduleNamePlusExt) {
              var ext,
                index = moduleNamePlusExt.lastIndexOf("."),
                segment = moduleNamePlusExt.split("/")[0],
                isRelative = segment === "." || segment === "..";

              //Have a file extension alias, and it is not the
              //dots from a relative path.
              if (index !== -1 && (!isRelative || index > 1)) {
                ext = moduleNamePlusExt.substring(
                  index,
                  moduleNamePlusExt.length
                );
                moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
              }

              return context.nameToUrl(
                normalize(moduleNamePlusExt, relMap && relMap.id, true),
                ext,
                true
              );
            }
750113
def _split_iso9660_filename(fullname):
    # type: (bytes) -> Tuple[bytes, bytes, bytes]
    '''
    
    '''
    namesplit = fullname.split(b';')
    version = b''
    if len(namesplit) > 1:
        version = namesplit.pop()

    rest = b';'.join(namesplit)

    dotsplit = rest.split(b'.')
    if len(dotsplit) == 1:
        name = dotsplit[0]
        extension = b''
    else:
        name = b'.'.join(dotsplit[:-1])
        extension = dotsplit[-1]

    return (name, extension, version)
1083643
def set_extension(self, ext):
        
        path = self._filename.split("/")
        parts = path[-1].split(".")
        if len(parts) == 1:
            parts.append(ext)
        else:
            parts[-1] = ext

        path[-1] = ".".join(parts)
        return File("/".join(path))
1112318
def punify_filename(filename):
    
    path, extension = splitext(filename)
    return path.encode('punycode').decode('utf8') + extension
405833
def filename_for(self, subpath):
        
        try:
            filename = self.readme_for(subpath)
            return os.path.relpath(filename, self.root_directory)
        except ReadmeNotFoundError:
            return None
787013
def opath_from_ext(self, ext):
        
        return os.path.join(self.workdir, self.prefix.odata + "_" + ext)
892900
def build_pyfile_path_from_docname(self, docfile):
        
        name, ext = os.path.splitext(docfile)
        expected_py_name = name.replace('.', '/') + '.py'
        return expected_py_name
1257067
function getExtensionlessFilename( filename ) {
	return filename.substr( 0, filename.length - path.extname( filename ).length);
}
493481
function basename (filename, ext) {
  return path.basename(
    filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'),
    ext
  )
}
1072116
def _filename(self_or_cls, filename):
        ""
        if not filename.endswith(self_or_cls.file_ext):
            return '%s.%s' % (filename, self_or_cls.file_ext)
        else:
            return filename