~jm-leddy/ubuntu/precise/ubiquity/lp929092

« back to all changes in this revision

Viewing changes to ubiquity/filteredcommand.py

  • Committer: Bazaar Package Importer
  • Author(s): Evan Dandrea, Evan Dandrea, Colin Watson
  • Date: 2009-11-13 10:41:42 UTC
  • mfrom: (281.1.2 karmic-updates)
  • Revision ID: james.westby@ubuntu.com-20091113104142-ghwoqmn0bko416c2
Tags: 2.1.0
[ Evan Dandrea ]
* Run X with -nolisten tcp (LP: #462394).
* Make sure we never try to install onto the live filesystem.
* Only print the filenames being blacklisted if in debug mode.
* Provide human readable sizes in the partitions-too-small warning
  (LP: #298974).
* Mark the "Installation Complete" window as always on top
  (LP: #462178).
* Fixes from Pychecker for the KDE frontend (kde_ui):
  - Don't import datetime or math.  The timezone code is in a separate
    module now.
  - Remove some unused variables.
  - Don't assign to a variable that's going to be immediately discarded.
* Signal to GTK+ when using a right-to-left language, so that it
  composes the interface from right to left (LP: #222845).
* Signal to the slideshow when the installer is using a right-to-left
  language (LP: #446989).
* Set SUDO_UID and SUDO_GID in ubiquity-dm so ubiquity knows what user
  to drop privileges to (LP: #422254).
* Do not try to configure networking in oem-config (LP: #471498).
* Make migration-assistant import failures non-fatal to the overall
  install.
* pkgsel now provides a debconf question to avoid warning the end user
  when the language packs could not be installed (LP: #471553).
* Make sure a device exists as part of the grub target device
  validation.
* Allow the user to retry grub installation with a different device on
  failure.
* Automatic update of included source packages: apt-setup
  1:0.42ubuntu1, choose-mirror 2.29ubuntu2, clock-setup 0.100ubuntu1,
  debian-installer-utils 1.71ubuntu1, grub-installer 1.47ubuntu1, hw-
  detect 1.73ubuntu1, netcfg 1.51ubuntu1, partman-base 135ubuntu1,
  tzsetup 1:0.26ubuntu1, user-setup 1.28ubuntu1.

[ Colin Watson ]
* Add a debian/rules target to run pychecker. I've fixed several warnings,
  but there are still several left so this is not yet enabled by default.
* Fix debconf frontend:
  - Start oem-config on stopping rc, as well as when starting display
    managers.
  - Add some missing imports (ubiquity.frontend.base.Controller,
    ubiquity.plugin.Plugin, ubiquity.i18n, signal,
    ubiquity.components.install).
  - If there's a containing debconf frontend, talk to it rather than using
    debconf-communicator.
  - Set a controller in the language plugin.
  - Use spaces rather than ${!TAB} in localechooser when using the debconf
    frontend, since debconf doesn't support the latter yet.
  - Don't handle user-setup preseeding for the debconf frontend.
  - Remove unused progress_position handling.
  - Fix exception names in ubi-network and ubi-tasks.
* Require Python 2.5, so we can now use hashlib rather than md5 and avoid
  a slew of warnings.
* Add an intro message noting that we're alpha again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import signal
25
25
import subprocess
26
26
import re
27
 
import syslog
28
27
 
29
28
import debconf
30
29
from ubiquity.debconfcommunicator import DebconfCommunicator
58
57
            return None
59
58
 
60
59
    @classmethod
61
 
    def debug_enabled(self):
 
60
    def debug_enabled(cls):
62
61
        return ('UBIQUITY_DEBUG_CORE' in os.environ and
63
62
                os.environ['UBIQUITY_DEBUG_CORE'] == '1')
64
63
 
65
64
    @classmethod
66
 
    def debug(self, fmt, *args):
67
 
        if self.debug_enabled():
 
65
    def debug(cls, fmt, *args):
 
66
        if cls.debug_enabled():
68
67
            import time
69
68
            # bizarre time formatting code per syslogd
70
69
            time_str = time.ctime()[4:19]
150
149
 
151
150
    def cleanup(self):
152
151
        self.db.shutdown()
 
152
        self.db = None
153
153
 
154
154
    def run_command(self, auto_process=False):
155
155
        # TODO cjwatson 2006-02-25: Hack to allow _apply functions to be run
397
397
            self.frontend.debconffilter_done(self)
398
398
            self.cleanup()
399
399
 
400
 
    def error(self, priority, question):
 
400
    def error(self, unused_priority, unused_question):
401
401
        self.succeeded = False
402
402
        self.done = False
403
403
        return True
408
408
 
409
409
    # TODO: Make the steps references in the individual components, rather than
410
410
    # having to define the relationship here?
411
 
    def run(self, priority, question):
 
411
    def run(self, unused_priority, question):
412
412
        if not self.frontend.installing:
413
413
            # Make sure any started progress bars are stopped.
414
 
            while self.frontend.progress_position.depth() != 0:
415
 
                self.frontend.debconf_progress_stop()
 
414
            if hasattr(self.frontend, 'progress_position'):
 
415
                while self.frontend.progress_position.depth() != 0:
 
416
                    self.frontend.debconf_progress_stop()
416
417
 
417
418
        self.current_question = question
418
419
        if not self.done:
419
420
            self.succeeded = False
420
 
            mod = __import__(self.__module__, fromlist=['NAME'])
 
421
            mod = __import__(self.__module__, globals(), locals(), ['NAME'])
421
422
            self.frontend.set_page(mod.NAME)
422
423
            self.enter_ui_loop()
423
424
        return self.succeeded
429
430
            progress_min, progress_max, self.description(progress_title))
430
431
        self.frontend.refresh()
431
432
 
432
 
    def progress_set(self, progress_title, progress_val):
 
433
    def progress_set(self, unused_progress_title, progress_val):
433
434
        ret = self.frontend.debconf_progress_set(progress_val)
434
435
        self.frontend.refresh()
435
436
        return ret
436
437
 
437
 
    def progress_step(self, progress_title, progress_inc):
 
438
    def progress_step(self, unused_progress_title, progress_inc):
438
439
        ret = self.frontend.debconf_progress_step(progress_inc)
439
440
        self.frontend.refresh()
440
441
        return ret
441
442
 
442
 
    def progress_info(self, progress_title, progress_info):
 
443
    def progress_info(self, unused_progress_title, progress_info):
443
444
        try:
444
445
            ret = self.frontend.debconf_progress_info(
445
446
                self.description(progress_info))
449
450
            # ignore unknown info templates
450
451
            return True
451
452
 
452
 
    def progress_stop(self, progress_title):
 
453
    def progress_stop(self, unused_progress_title):
453
454
        self.frontend.debconf_progress_stop()
454
455
        self.frontend.refresh()
455
456
 
456
 
    def progress_region(self, progress_title,
 
457
    def progress_region(self, unused_progress_title,
457
458
                        progress_region_start, progress_region_end):
458
459
        self.frontend.debconf_progress_region(progress_region_start,
459
460
                                              progress_region_end)
460
 
 
461
 
if __name__ == '__main__':
462
 
    fc = FilteredCommand()
463
 
    fc.run(sys.argv[1])