Did I find the right examples for you? yes no

All Samples(5)  |  Call(4)  |  Derive(0)  |  Import(1)
Join any arbitrary strings into a forward-slash delimited list.
Do not strip leading / from first element, nor trailing / from last element.

        def url_join(*args):
    """Join any arbitrary strings into a forward-slash delimited list.
    Do not strip leading / from first element, nor trailing / from last element."""
    if len(args) == 0:
        return ""

    args = get_flat_list(args)

    if len(args) == 1:
        return str(args[0])

    else:
        args = [str(arg).replace("\\", "/") for arg in args]

        work = [args[0]]
        for arg in args[1:]:
            if arg.startswith("/"):
                work.append(arg[1:])
            else:
                work.append(arg)

        joined = reduce(os.path.join, work)

    return joined.replace("\\", "/")
        


src/k/e/keryx-HEAD/keryx/unwrapt/definitions/aptdef/__init__.py   keryx(Download)
from DefinitionBase import DefinitionBase
from Download import download_url, textprogress, httpExists
from utils import format_number, to_filename, to_url, url_join
 
from DpkgVersion import DpkgVersion
                r["dist"] = dist
                r["section"] = section
                r["url"] = url_join(url, "dists", dist, section)
 
                self.repositories.append(r)

src/d/j/django-site-skins-0.1-2/skins/skin.py   django-site-skins(Download)
    def _media_url(self):
        return utils.url_join(current_media_url(), 'skins', self.key, '/')
 
    media_url = property(fget=_media_url)
 

src/s/i/SiteBaker-1.8.2/sitebaker/plugins/blog_plugin.py   SiteBaker(Download)
    paths = config.get('blog', 'paths').split(',')
    path = paths[0]
    newpath = utils.url_join(kernel.options.output, path, time.strftime('%Y/%m/%d'))
    if not os.path.exists(newpath):
        os.makedirs(newpath)

src/s/i/SiteBaker-1.8.2/sitebaker/pages.py   SiteBaker(Download)
        name = name[0:-5]
 
        url = utils.url_join(base_path, name)
        config = utils.find_config(kernel.configs, base_path)
        page = Page(kernel, path, output_path, url, config)