コード例 #1
0
ファイル: install_misc.py プロジェクト: thnguyn2/ECE_527_MP
 def __init__(self, db, title, info_starting, info):
     AcquireProgress.__init__(self)
     self.db = db
     self.title = title
     self.info_starting = info_starting
     self.info = info
     self.old_capb = None
     self.eta = 0.0
コード例 #2
0
 def __init__(self, db, title, info_starting, info):
     AcquireProgress.__init__(self)
     self.db = db
     self.title = title
     self.info_starting = info_starting
     self.info = info
     self.old_capb = None
     self.eta = 0.0
コード例 #3
0
ファイル: install_misc.py プロジェクト: thnguyn2/ECE_527_MP
    def pulse(self,owner=None):
        AcquireProgress.pulse(self,owner)
        self.percent = (((self.current_bytes + self.current_items) * 100.0) /
                        float(self.total_bytes + self.total_items))
        if self.current_cps > 0:
            self.eta = ((self.total_bytes - self.current_bytes) /
                        float(self.current_cps))

        try:
            if os.environ['UBIQUITY_FRONTEND'] != 'debconf_ui':
                self.db.progress('SET', int(self.percent))
        except debconf.DebconfError:
            return False
        if self.eta != 0.0:
            time_str = "%d:%02d" % divmod(int(self.eta), 60)
            self.db.subst(self.info, 'TIME', time_str)
            try:
                self.db.progress('INFO', self.info)
            except debconf.DebconfError:
                return False
        return True
コード例 #4
0
    def pulse(self, owner=None):
        AcquireProgress.pulse(self, owner)
        self.percent = (((self.current_bytes + self.current_items) * 100.0) /
                        float(self.total_bytes + self.total_items))
        if self.current_cps > 0:
            self.eta = ((self.total_bytes - self.current_bytes) /
                        float(self.current_cps))

        try:
            if os.environ['UBIQUITY_FRONTEND'] != 'debconf_ui':
                self.db.progress('SET', int(self.percent))
        except debconf.DebconfError:
            return False
        if self.eta != 0.0:
            time_str = "%d:%02d" % divmod(int(self.eta), 60)
            self.db.subst(self.info, 'TIME', time_str)
            try:
                self.db.progress('INFO', self.info)
            except debconf.DebconfError:
                return False
        return True