Return a relative version of the workdir
761152
def relworkdir(self):
        """"""
        if getattr(self, "workdir", None) is None:
            return None
        try:
            return os.path.relpath(self.workdir)
        except OSError:
            # current working directory may not be defined!
            return self.workdir
565952
def get_gopath(self, target):
    """"""
    return os.path.join(self.workdir, target.id)
960705
def base_dir(self):
        """"""
        if self.root_dir:
            return op.join(self.root_dir, self.id)
        else:
            return None
277310
def relative_path(self, absolute_path, output_filename):
        """"""
        absolute_path = posixpath.join(settings.PIPELINE_ROOT, absolute_path)
        output_path = posixpath.join(settings.PIPELINE_ROOT, posixpath.dirname(output_filename))
        return relpath(absolute_path, output_path)
1218637
def include_dir(self, root):
        """"""
        parts = [root]
        parts.extend(self.pathname.split(os.path.sep))
        return "/".join(parts)
1291422
def coderelpath(coderoot, relpath):
    """"""
    from os import chdir, getcwd, path
    cd = getcwd()
    chdir(coderoot)
    result = path.abspath(relpath)
    chdir(cd)
    return result
788722
def relative_path(path):
    
    return os.path.join(os.path.dirname(__file__), path)
354075
def is_workdir(cls, path):
        
        try:
            cls(path=path).load()
        except MalformedWorkdir:
            return False

        return True
1239397
def get_vs_dir_from_tool_dir(self):
        
        index = self.tool_dir.find(r'Common7\Tools')
        return self.tool_dir[:index]
289575
def get_versioned_files(cls):
        """"""
        files = cls._git_ls_files()
        submodules = cls._list_submodules()
        for subdir in submodules:
            subdir = os.path.relpath(subdir).replace(os.path.sep, '/')
            files += add_prefix_to_each(subdir, cls._git_ls_files(subdir))
        return add_directories(files)
970054
def getReposPackageFolder():
	""""""
	libdir = sysconfig.get_python_lib()
	repodir = os.path.join(libdir, "calcrepo", "repos")
	return repodir
1056716
def getdir(self, source):
        """"""
        subdir = posixpath.join(self.pdir, source._tok)
        try:
            self.fs.rm(subdir, True)
        except Exception as e:
            logger.debug("Directory clear failed: %s" % e)
        self.fs.mkdirs(subdir)
        return subdir
891054
def staticdir():
    """"""
    root = os.path.abspath(os.path.dirname(__file__))
    return os.path.join(root, "static")
848218
def mk_dir(self) :
        """"""
        if not os.path.exists(self.abs) :
            os.makedirs(self.abs)
479056
def _relative_path_to(path_list, filename):
    """"""
    return os.path.join(
        os.path.relpath(os.path.join(*path_list), os.getcwd()),
        filename
    )
566095
def get_dir_relpath(base, relpath):
    
    from os import path
    xbase = path.abspath(path.expanduser(base))
    if not path.isdir(xbase):
        return path.join(xbase, relpath)
    
    if relpath[0:2] == "./":
        return path.join(xbase, relpath[2::])
    else:
        from os import chdir, getcwd
        cd = getcwd()
        chdir(xbase)
        result = path.abspath(relpath)
        chdir(cd)
        return result
1144647
def Glob(self, pathname, ondisk=True, source=True, strings=False, exclude=None, cwd=None):
        
        if cwd is None:
            cwd = self.getcwd()
        return cwd.glob(pathname, ondisk, source, strings, exclude)