makes an absolute path name to a relative pathname.
549430
def make_path_relative(path):
    
    if os.path.isabs(path):
        drive_s,path = os.path.splitdrive(path)

        import re
        if not drive_s:
            path=re.compile("/*(.*)").findall(path)[0]
        else:
            path=path[1:]

    assert( not os.path.isabs( path ) ), path
    return path
496250
def relative_path(self, key):
    ''''''
    key = str(key)                # stringify
    key = key.replace(':', '/')   # turn namespace delimiters into slashes
    key = key[1:]                 # remove first slash (absolute)
    if not self.case_sensitive:
      key = key.lower()           # coerce to lowercase
    return os.path.normpath(key)
775822
def _get_relative_path(self):
    """"""
    param_string = self._get_query_string()
    if self.path is None:
      path = '/'
    else:
      path = self.path
    if param_string:
      return '?'.join([path, param_string])
    else:
      return path
67629
def expand_path(*paths):
    """"""
    return os.path.join(
        os.path.dirname(os.path.realpath(sys.argv[0])), *paths)
1275327
def get_absolute_path(self, path):
        '''
        
        '''
        if os.path.isabs(path):
            return path
        else:
            return os.path.abspath(os.path.join(self.config.BASEDIR, path))
281545
def pathify(basenames, examples_dir="examples/"):  # pragma: no cover
    """"""
    example = examples_dir.replace("/", ".")
    return [example + basename for basename in basenames]
1359628
def expandPath (pathname, prefix=None):
    
    if prefix is None:
        prefix = ''

    expanded = pathname

    if pathname[0] == '~':
        expanded = os.path.expanduser(pathname)
    elif pathname[0] != '/':
        expanded = os.path.join(prefix, pathname)

    return os.path.abspath(expanded)
950816
def _set_relative_pythonpath(self, value):
        """"""
        self.pythonpath = [osp.abspath(osp.join(self.root_path, path))
                           for path in value]
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)
1324924
def base_path(self):
        """"""
        return os.path.join(self.conn.abs_root, self.name)
231034
def basename(path, ext=""):
    """"""
    import os.path
    if ext is False:
        return os.path.basename(path).replace(extname(path), "")
    else:
        return os.path.basename(path).replace(ext, "")
1030969
def abspath(raw):
    """"""
    path_bits = []
    if raw.find('/') != -1:
        path_bits = raw.split('/')
    elif raw.find('\\') != -1:
        path_bits = raw.split('\\')
    else:
        path_bits = [raw]

    return os.path.abspath(os.sep.join(path_bits))
654740
def name_to_absolute(x):
    
    for c in ["-", "*", ":"]:
        x = x.replace(c, "_")
    x = x.lower()
    return x
744563
def hard_path(path, prefix_dir):
    """"""
    relative = abspath("%s/%s" % (prefix_dir, path))
    a_path = abspath(path)
    if os.path.exists(relative):
        LOG.debug("using relative path %s (%s)", relative, path)
        return relative

    LOG.debug("using absolute path %s", a_path)
    return a_path
1133533
def _absolutePaths(self, paths):
		
		slashes = [p.replace('\\', '/') for p in paths]
		stripped = [p.replace('../', '') if p.startswith('../') else p for p in slashes]
		return list([p if (os.path.isabs(p) or '/' not in p) else os.path.join(self.engineRoot, self.engineSourceDir, p) for p in stripped])
534072
def get_abs_path(relative_path):
    
    abs_path = os.path.sep.join(
        os.path.abspath(sys.modules[__name__].__file__).split(os.path.sep)[:-1])
    abs_path = os.path.abspath(abs_path + os.path.sep + relative_path)
    return abs_path
322775
def make_dir(self, path, relative=False):
        
        if not relative:
            path = self.relpath(path)
        self._make_dir(self.get_client_kwargs(self.ensure_dir_path(
            path, relative=True)))