def speed_set(self): limit = cfg.bandwidth_max.get_int() perc = cfg.bandwidth_perc() if limit and perc: self.bandwidth_perc = perc self.bandwidth_limit = limit * perc / 100 else: self.bandwidth_perc = 0 self.bandwidth_limit = 0