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

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
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/f/l/flashbake-0.27/src/flashbake/plugins/scrivener.py   flashbake(Download)
import re
 
from flashbake.compat import relpath, pickle
 
def find_scrivener_projects(hot_files, config, flush_cache=False):
def find_scrivener_project_contents(hot_files, scrivener_project):
    for path, dirs, files in os.walk(os.path.join(  # @UnusedVariable
            hot_files.project_dir, scrivener_project)):
        rpath = relpath(path, hot_files.project_dir)
        for filename in files:

src/f/l/flashbake-HEAD/src/flashbake/plugins/scrivener.py   flashbake(Download)
import re
 
from flashbake.compat import relpath, pickle
 
def find_scrivener_projects(hot_files, config, flush_cache=False):
def find_scrivener_project_contents(hot_files, scrivener_project):
    for path, dirs, files in os.walk(os.path.join(  # @UnusedVariable
            hot_files.project_dir, scrivener_project)):
        rpath = relpath(path, hot_files.project_dir)
        for filename in files:

src/f/l/flashbake-0.27/src/flashbake/__init__.py   flashbake(Download)
 
from flashbake.plugins import PluginError, PLUGIN_ERRORS
from flashbake.compat import relpath, next_, iglob
from types import *
import commands
    def __drop_prefix(self, prefix, filepath):
        return relpath(filepath, prefix)
 
def find_executable(executable):
    ex_paths = (os.path.join(path, executable) for path in \

src/f/l/flashbake-HEAD/src/flashbake/__init__.py   flashbake(Download)
 
from flashbake.plugins import PluginError, PLUGIN_ERRORS
from flashbake.compat import relpath, next_, iglob
from types import *
import commands
    def __drop_prefix(self, prefix, filepath):
        return relpath(filepath, prefix)
 
def find_executable(executable):
    ex_paths = (os.path.join(path, executable) for path in \