~brian-murray/aptdaemon/bug-1436725

« back to all changes in this revision

Viewing changes to aptdaemon/console.py

  • Committer: Sebastian Heinlein
  • Date: 2013-07-27 10:04:48 UTC
  • mfrom: (955.2.17 workerseparation)
  • Revision ID: devel@glatzor.de-20130727100448-gqleep7qusfhhw89
Merge with latest workerseparation branch to remove python-apt dependency from
the client code

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
import sys
40
40
 
41
41
from aptsources.sourceslist import SourceEntry
42
 
import apt_pkg
43
42
from gi.repository import GLib
44
43
import dbus.glib
45
44
import dbus.mainloop.glib
246
245
                             bytes_done, bytes_total, speed, eta):
247
246
        """Callback for the ProgressDetails signal of the transaction."""
248
247
        if bytes_total and speed:
249
 
            self._progress_details = (_("Downloaded %sB of %sB at %sB/s") %
250
 
                                      (apt_pkg.size_to_str(bytes_done),
251
 
                                       apt_pkg.size_to_str(bytes_total),
252
 
                                       apt_pkg.size_to_str(speed)))
 
248
            self._progress_details = (
 
249
                _("Downloaded %sB of %sB at %sB/s") %
 
250
                (client.get_size_string(bytes_done),
 
251
                 client.get_size_string(bytes_total),
 
252
                 client.get_size_string(speed)))
253
253
        elif bytes_total:
254
 
            self._progress_details = (_("Downloaded %sB of %sB") %
255
 
                                      (apt_pkg.size_to_str(bytes_done),
256
 
                                       apt_pkg.size_to_str(bytes_total)))
 
254
            self._progress_details = (
 
255
                _("Downloaded %sB of %sB") %
 
256
                (client.get_size_string(bytes_done),
 
257
                 client.get_size_string(bytes_total)))
257
258
        else:
258
259
            self._progress_details = ""
259
260
        self._update_progress()
504
505
 
505
506
        if self._transaction.download:
506
507
            print(_("Need to get %sB of archives.") %
507
 
                  apt_pkg.size_to_str(self._transaction.download))
 
508
                  client.get_size_string(self._transaction.download))
508
509
        if self._transaction.space > 0:
509
510
            print(_("After this operation, %sB of additional disk space "
510
511
                    "will be used.") %
511
 
                  apt_pkg.size_to_str(self._transaction.space))
 
512
                  client.get_size_string(self._transaction.space))
512
513
        elif self._transaction.space < 0:
513
514
            print(_("After this operation, %sB of additional disk space "
514
515
                    "will be freed.") %
515
 
                  apt_pkg.size_to_str(self._transaction.space))
516
 
        if (not apt_pkg.config.find_b("APT::Get::Assume-Yes") and
517
 
            (self._transaction.space or self._transaction.download or
518
 
             installs or upgrades or downgrades or removals or kepts or
519
 
             reinstalls)):
 
516
                  client.get_size_string(self._transaction.space))
 
517
        if (self._transaction.space or self._transaction.download or
 
518
                installs or upgrades or downgrades or removals or kepts or
 
519
                reinstalls):
520
520
            try:
521
521
                if PY3K:
522
522
                    cont = input(_("Do you want to continue [Y/n]?"))