Пример #1
0
    def packageFinished(self, package, success):
        PackageInstaller.packageFinished(self, package, success)
        if not success:
            print 'Failed to download %s' % package.packageName
            return None

        phase = self.launcher.phasesByPackageName[package.packageName]
        self.launcher.phaseData[phase].markComplete()
Пример #2
0
 def packageProgress(self, package, progress):
     PackageInstaller.packageProgress(self, package, progress)
     percent = int(progress * 100.0 + 0.5)
     phase = self.launcher.phasesByPackageName[package.packageName]
     self.launcher.phaseData[phase].percent = percent
     if (phase, percent) != self.lastProgress:
         messenger.send('launcherPercentPhaseComplete',
                        [phase, percent, None, None])
         self.lastProgress = (phase, percent)
Пример #3
0
    def downloadFinished(self, success):
        """ This callback is made when all of the packages have been
        downloaded and installed (or there has been some failure).  If
        all packages where successfully installed, success is True.

        If there were no packages that required downloading, this
        callback will be made immediately, *without* a corresponding
        call to downloadStarted(). """

        PackageInstaller.downloadFinished(self, success)
        if not success:
            print "Failed to download all packages."
Пример #4
0
    def packageProgress(self, package, progress):
        """ This callback is made repeatedly between packageStarted()
        and packageFinished() to update the current progress on the
        indicated package only.  The progress value ranges from 0
        (beginning) to 1 (complete). """

        PackageInstaller.packageProgress(self, package, progress)
        percent = int(progress * 100.0 + 0.5)
        phase = self.launcher.phasesByPackageName[package.packageName]
        self.launcher.phaseData[phase].percent = percent
        if (phase, percent) != self.lastProgress:
            messenger.send('launcherPercentPhaseComplete',
                           [phase, percent, None, None])
            self.lastProgress = (phase, percent)
Пример #5
0
    def packageFinished(self, package, success):
        """ This callback is made for each package between
        downloadStarted() and downloadFinished() to indicate that a
        package has finished downloading.  If success is true, there
        were no problems and the package is now installed.

        If this package did not require downloading (because it was
        already downloaded), this callback will be made immediately,
        *without* a corresponding call to packageStarted(), and may
        even be made before downloadStarted(). """

        PackageInstaller.packageFinished(self, package, success)
        if not success:
            print "Failed to download %s" % (package.packageName)
            self.launcher.setPandaErrorCode(6)
            sys.exit()

        phase = self.launcher.phasesByPackageName[package.packageName]
        self.launcher.phaseData[phase].markComplete()
Пример #6
0
    def __init__(self, appRunner, parent = None, **kw):
        PackageInstaller.__init__(self, appRunner)

        optiondefs = (
            ('borderWidth',    (0.01, 0.01),       None),
            ('relief',         DGG.SUNKEN,         self.setRelief),
            ('range',          1,                  self.setRange),
            ('barBorderWidth', (0.01, 0.01),       self.setBarBorderWidth),
            ('barColor',       (0.424, 0.647, 0.878, 1),  self.setBarColor),
            ('barRelief',      DGG.RAISED,         self.setBarRelief),
            ('text',           'Starting',         self.setText),
            ('text_pos',       (0, -0.025),        None),
            ('text_scale',     0.1,                None),
            ('perPackage',     False,              None),
            ('updateText',     True,               None),
            ('finished',       None,               None),
            )
        self.defineoptions(kw, optiondefs)
        DirectWaitBar.__init__(self, parent, **kw)
        self.initialiseoptions(DWBPackageInstaller)
        self.updateBarStyle()

        # Hidden by default until the download begins.
        self.hide()
Пример #7
0
    def __init__(self, appRunner, parent=None, **kw):
        PackageInstaller.__init__(self, appRunner)

        optiondefs = (
            ('borderWidth', (0.01, 0.01), None),
            ('relief', DGG.SUNKEN, self.setRelief),
            ('range', 1, self.setRange),
            ('barBorderWidth', (0.01, 0.01), self.setBarBorderWidth),
            ('barColor', (0.424, 0.647, 0.878, 1), self.setBarColor),
            ('barRelief', DGG.RAISED, self.setBarRelief),
            ('text', 'Starting', self.setText),
            ('text_pos', (0, -0.025), None),
            ('text_scale', 0.1, None),
            ('perPackage', False, None),
            ('updateText', True, None),
            ('finished', None, None),
        )
        self.defineoptions(kw, optiondefs)
        DirectWaitBar.__init__(self, parent, **kw)
        self.initialiseoptions(DWBPackageInstaller)
        self.updateBarStyle()

        # Hidden by default until the download begins.
        self.hide()
Пример #8
0
 def __init__(self, launcher):
     PackageInstaller.__init__(self, launcher.appRunner)
     self.launcher = launcher
     self.lastProgress = None
Пример #9
0
 def destroy(self):
     PackageInstaller.cleanup(self)
     DirectWaitBar.destroy(self)
Пример #10
0
 def destroy(self):
     PackageInstaller.cleanup(self)
     DirectWaitBar.destroy(self)
Пример #11
0
 def downloadFinished(self, success):
     PackageInstaller.downloadFinished(self, success)
     if not success:
         print 'Failed to download all packages.'