Sha256: 13ff0abd4a421e2105c9659c147cad77a4c788383feb235df70abf129882f66d

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

Contents

module Actions
  module Pulp
    module Repository
      module Presenters
        class IsoPresenter < AbstractSyncPresenter
          def progress
            total_bytes == 0 ? 0.01 : finished_bytes.to_f / total_bytes
          end

          private

          def humanized_details
            ret = []
            ret << _("Cancelled.") if cancelled?
            ret << _("New ISOs: %s") % num_isos
            ret.join("\n")
          end

          def num_isos
            task_progress_details && task_progress_details['num_isos'] || 0
          end

          def total_bytes
            task_progress_details && task_progress_details['total_bytes'] || 0
          end

          def finished_bytes
            task_progress_details && task_progress_details['finished_bytes'] || 0
          end

          def task_progress_details
            task_progress && task_progress['iso_importer']
          end

          def task_progress
            sync_task['progress_report']
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
katello-2.4.5 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.4 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.3 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-3.0.0.rc5 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.2 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-3.0.0.rc4 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-3.0.0.rc3 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-3.0.0.rc2 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-3.0.0.rc1 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.1 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.0 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.0.rc3 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.0.rc2 app/lib/actions/pulp/repository/presenters/iso_presenter.rb
katello-2.4.0.rc1 app/lib/actions/pulp/repository/presenters/iso_presenter.rb