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

All Samples(30)  |  Call(18)  |  Derive(0)  |  Import(12)
Reverse of uri_split()

        def uri_join(segments,without_auth=False):
    """
       Reverse of uri_split()
    """
    result = ''

    try:
        result += segments["scheme"] + '://'
    except:
        pass

    if without_auth is False:
        try:
            result += segments["user"]
            try:
                result += ':' + segments["passwd"]
            except:
                pass
            result += '@'
        except:
            pass

    try:
        result += segments["host"]
    except:
        pass

    try:
        result += ':' + segments["port"]
    except:
        pass

    try:
        if segments["path"] is None or segments["path"] == "":
            segments["path"] = "/"
        if result != "":
            result += segments["path"]
    except:
        pass

    try:
        result += '?' + segments["query"]
    except:
        pass
    try:
        result += '#' + segments["fragment"]
    except:
        pass

    return result
        


src/k/a/karesansui-HEAD/karesansui/lib/virt/virt.py   karesansui(Download)
from karesansui.lib.utils import copy_file            as CopyFile
from karesansui.lib.net.http import wget              as DownloadFile
from karesansui.lib.utils import is_uuid, get_ifconfig_info, r_chgrp, r_chmod, \
  getfilesize_str, get_filesize_MB, get_disk_img_info, available_virt_uris, \
  is_iso9660_filesystem_format, is_windows_bootable_iso, is_darwin_bootable_iso, \
            self.open(uri, creds)
        except:
            raise KaresansuiVirtException(_("Cannot open '%s'") % uri_join(uri_split(uri.encode('utf8')), without_auth=True))
 
    def open(self, uri, creds="foo:pass"):

src/k/a/karesansui-HEAD/karesansui/gadget/guest.py   karesansui(Download)
from karesansui.lib.const import XEN_KEYMAP_DIR, KVM_KEYMAP_DIR, KVM_BRIDGE_PREFIX
 
from karesansui.lib.utils import comma_split, \
     generate_mac_address, is_param, \
     next_number, generate_uuid, string_from_uuid, uniq_sort, \
            uri_guests_name = {}
            segs = uri_split(model.hostname)
            uri = uri_join(segs, without_auth=True)
            creds = ''
            if segs["user"] is not None:

src/k/a/karesansui-HEAD/karesansui/gadget/hostby1.py   karesansui(Download)
from karesansui.lib.merge import MergeHost
from karesansui.lib.virt.virt import KaresansuiVirtConnection, KaresansuiVirtConnectionAuth
from karesansui.lib.utils import \
    comma_split, uniq_sort, is_param, json_dumps, \
    get_proc_cpuinfo, get_proc_meminfo, get_partition_info, \
                if model.attribute == 2:
                    segs = uri_split(model.hostname)
                    uri = uri_join(segs, without_auth=True)
                    creds = ''
                    if segs["user"] is not None:
            if model.attribute == 2:
                segs = uri_split(model.hostname)
                uri = uri_join(segs, without_auth=True)
                creds = ''
                if segs["user"] is not None:
                    if is_param(self.input, "m_auth_passwd") and self.input.m_auth_passwd:
                        segs["passwd"] = self.input.m_auth_passwd
                host.hostname = uri_join(segs)
 
        if is_param(self.input, "note_title"):

src/k/a/karesansui-HEAD/karesansui/gadget/uriguestby1status.py   karesansui(Download)
from karesansui.lib.const import KARESANSUI_TMP_DIR
 
from karesansui.lib.utils import \
    comma_split, uniq_sort, is_param, json_dumps, \
    uri_split, uri_join
                info = {}
                segs = uri_split(model.hostname)
                uri = uri_join(segs, without_auth=True)
                creds = ''
                if segs["user"] is not None:
            info = {}
            segs = uri_split(model.hostname)
            uri = uri_join(segs, without_auth=True)
            creds = ''
            if segs["user"] is not None:

src/k/a/karesansui-HEAD/bin/start_guest.py   karesansui(Download)
                                         VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTDOWN
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import uri_split, uri_join
 
except ImportError, e:
                    conn = KaresansuiVirtConnection(readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)
                    conn = KaresansuiVirtConnection(uri, readonly=False)
 
            else:
                if opts.uri is None:
                    conn = KaresansuiVirtConnectionAuth(creds=passwd,readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)

src/k/a/karesansui-HEAD/bin/shutdown_guest.py   karesansui(Download)
                                         VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTDOWN
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import uri_split, uri_join
 
except ImportError, e:
                    conn = KaresansuiVirtConnection(readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)
                    conn = KaresansuiVirtConnection(uri, readonly=False)
 
            else:
                if opts.uri is None:
                    conn = KaresansuiVirtConnectionAuth(creds=passwd,readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)

src/k/a/karesansui-HEAD/bin/reboot_guest.py   karesansui(Download)
                                         VIR_DOMAIN_SHUTOFF, VIR_DOMAIN_SHUTDOWN
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import uri_split, uri_join
 
except ImportError, e:
                    conn = KaresansuiVirtConnection(readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)
                    conn = KaresansuiVirtConnection(uri, readonly=False)
 
            else:
                if opts.uri is None:
                    conn = KaresansuiVirtConnectionAuth(creds=passwd,readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)

src/k/a/karesansui-HEAD/bin/autostart_guest.py   karesansui(Download)
                                         KaresansuiVirtConnectionAuth
    from karesansui.lib.utils import load_locale
    from karesansui.lib.utils import uri_split, uri_join
 
except ImportError, e:
                    conn = KaresansuiVirtConnection(readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)
                    conn = KaresansuiVirtConnection(uri, readonly=False)
 
            else:
                if opts.uri is None:
                    conn = KaresansuiVirtConnectionAuth(creds=passwd,readonly=False)
                else:
                    uri = uri_join(uri_split(opts.uri), without_auth=True)

src/k/a/karesansui-HEAD/karesansui/gadget/uriguestby1.py   karesansui(Download)
from karesansui.lib.rest import Rest, auth
 
from karesansui.lib.utils import \
    comma_split, uniq_sort, is_param, json_dumps, \
    uri_split, uri_join
                info = {}
                segs = uri_split(model.hostname)
                uri = uri_join(segs, without_auth=True)
                creds = ''
                if segs["user"] is not None:

src/k/a/karesansui-HEAD/karesansui/lib/merge.py   karesansui(Download)
from karesansui.db.model.user import User
from karesansui.db.model.notebook import Notebook
from karesansui.lib.utils import uri_split, uri_join
 
class MergeHost:
                for guest_name in kvc.list_active_guest() + kvc.list_inactive_guest():
                    #print guest_name
                    self.logger.info("Reading guest '%s' on '%s' ..." % (guest_name,uri_join(uri_split(model.hostname),without_auth=True)))
 
                    _virt = kvc.search_kvg_guests(guest_name)

  1 | 2  Next