示例#1
0
文件: urlinstall.py 项目: Sudoka/base
    def __init__(self, url, rootPath, intf):
	InstallMethod.__init__(self, url, rootPath, intf)

        (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)

	try:
            socket.inet_pton(socket.AF_INET6, netloc)
            netloc = '[' + netloc + ']'
        except:
            pass

        # encoding fun so that we can handle absolute paths
        if scheme == "ftp" and path and path.startswith("//"):
            path = "/%2F" + path[1:]

        self.baseUrl = urlparse.urlunsplit((scheme,netloc,path,query,fragid))
        self.pkgUrl = self.baseUrl

	# ROCKS
        # self.__checkUrlForIsoMounts()
	# ROCKS

        self.currentMedia = []

        self.messageWindow = intf.messageWindow
        self.progressWindow = intf.progressWindow
        self.waitWindow = intf.waitWindow
        self.loopbackFile = None
        self.tree = "/mnt/source"
        for path in ("/tmp/ramfs/stage2.img", "/tmp/ramfs/minstg2.img"):
            if os.access(path, os.R_OK):
                # we used a remote stage2. no need to worry about ejecting CDs
                self.tree = None
                break
示例#2
0
文件: urlinstall.py 项目: hocks/core
    def __init__(self, url, rootPath, intf):
        InstallMethod.__init__(self, url, rootPath, intf)

        (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)

        try:
            socket.inet_pton(socket.AF_INET6, netloc)
            netloc = '[' + netloc + ']'
        except:
            pass

    # encoding fun so that we can handle absolute paths
        if scheme == "ftp" and path and path.startswith("//"):
            path = "/%2F" + path[1:]

        self.baseUrl = urlparse.urlunsplit(
            (scheme, netloc, path, query, fragid))
        self.pkgUrl = self.baseUrl

        # ROCKS
        # self.__checkUrlForIsoMounts()
        # ROCKS

        self.currentMedia = []

        self.messageWindow = intf.messageWindow
        self.progressWindow = intf.progressWindow
        self.waitWindow = intf.waitWindow
        self.loopbackFile = None
        self.tree = "/mnt/source"
        for path in ("/tmp/ramfs/stage2.img", "/tmp/ramfs/minstg2.img"):
            if os.access(path, os.R_OK):
                # we used a remote stage2. no need to worry about ejecting CDs
                self.tree = None
                break
示例#3
0
    def __init__(self, device, type, path, messageWindow, rootPath):
        InstallMethod.__init__(self, rootPath)
        self.device = device
        self.path = path
        self.fstype = type
        self.fnames = {}
        self.isoDirIsMounted = 0
        self.mediaIsMounted = 0
        self.messageWindow = messageWindow

        # Go ahead and poke through the directory looking for interesting
        # iso images
        self.mountDirectory()
        self.discImages = findIsoImages(self.isoDir + '/' + self.path,
                                        messageWindow)
        self.umountDirectory()
示例#4
0
    def __init__(self, url, rootPath):
        InstallMethod.__init__(self, rootPath)

        if url.startswith("ftp"):
            isFtp = 1
        else:
            isFtp = 0

    # build up the url.  this is tricky so that we can replace
    # the first instance of // with /%3F to do absolute URLs right
        i = string.index(url, '://') + 3
        self.baseUrl = url[:i]
        rem = url[i:]

        i = string.index(rem, '/') + 1
        self.baseUrl = self.baseUrl + rem[:i]
        rem = rem[i:]

        # encoding fun so that we can handle absolute paths
        if rem.startswith("/") and isFtp:
            rem = "%2F" + rem[1:]

        self.baseUrl = self.baseUrl + rem

        if self.baseUrl[-1] == "/":
            self.baseUrl = self.baseUrl[:-1]

        # self.baseUrl points at the path which contains the 'RedHat'
        # directory with the hdlist.

        if self.baseUrl[-6:] == "/disc1":
            self.multiDiscs = 1
            self.pkgUrl = self.baseUrl[:-6]
        else:
            self.multiDiscs = 0
            self.pkgUrl = self.baseUrl

        self.intf = None
    def __init__(self, tree, rootPath, intf):
	InstallMethod.__init__(self, tree, rootPath, intf)
	self.tree = tree
	self.isoPath = tree
        self.splitmethod = True
示例#6
0
    def __init__(self, tree, rootPath, intf):
	InstallMethod.__init__(self, tree, rootPath, intf)
	self.tree = tree
	self.isoPath = tree
        self.splitmethod = True
示例#7
0
    def __init__(self, tree, rootPath):
	InstallMethod.__init__(self, rootPath)
	self.tree = tree
        self.currentIso = None