Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(52)  |  Call(26)  |  Derive(0)  |  Import(26)
Return a relative version of a path

        def relpath(path, start=curdir):
    """Return a relative version of a path"""

    if not path:
        raise ValueError("no path specified")

    start_list = [x for x in abspath(start).split(sep) if x]
    path_list = [x for x in abspath(path).split(sep) if x]

    # Work out how much of the filepath is shared by start and path.
    i = len(commonprefix([start_list, path_list]))

    rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
    if not rel_list:
        return curdir
    return join(*rel_list)
        


src/h/u/hue-HEAD/desktop/core/ext-py/Babel-0.9.6/babel/messages/extract.py   hue(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/Babel-0.9.6/babel/messages/extract.py   hortonworks-sandbox(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/p/l/plexnet-HEAD/third_party/python/babel/messages/extract.py   plexnet(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath, set
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/f/i/FireCheckIn-HEAD/kay/lib/babel/messages/extract.py   FireCheckIn(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath, set
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/k/a/kay-HEAD/kay/lib/babel/messages/extract.py   kay(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath, set
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/k/i/kitsune-HEAD/vendor/packages/Babel/babel/messages/extract.py   kitsune(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/m/i/microblog-HEAD/flask/lib/python2.7/site-packages/babel/messages/extract.py   microblog(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from babel._compat import PY2, text_type
from textwrap import dedent
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/s/o/socorro-HEAD/webapp-django/vendor/lib/python/babel/messages/extract.py   socorro(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/f/j/fjord-HEAD/vendor/packages/Babel/babel/messages/extract.py   fjord(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from babel._compat import PY2, text_type
from textwrap import dedent
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

src/g/a/gae-boilerplate-HEAD/bp_includes/external/babel/messages/extract.py   gae-boilerplate(Download)
from tokenize import generate_tokens, COMMENT, NAME, OP, STRING
 
from babel.util import parse_encoding, pathmatch, relpath
from textwrap import dedent
 
        for filename in filenames:
            filename = relpath(
                os.path.join(root, filename).replace(os.sep, '/'),
                dirname
            )

  1 | 2 | 3  Next