Beispiel #1
0
 def end(self, user_obj, instance):
     """
         called when this rule ends for user_obj     
         
         user_obj (User.User instance): object of user that this rule change for         
         instance (integer): instance number of user             
     """
     ChargeRule.end(self, user_obj, instance)
     if self.bandwidth_limit > 0:
         simple_bw_limit.removeLimitOnUser(user_obj, instance)
     self.__applyBwLimit(user_obj, instance, "remove")
    def end(self,user_obj,instance):
	"""
	    called when this rule ends for user_obj	
	    
	    user_obj (User.User instance): object of user that this rule change for	    
	    instance (integer): instance number of user 	    
	"""
	ChargeRule.end(self,user_obj,instance)
	if self.bandwidth_limit>0:
	    simple_bw_limit.removeLimitOnUser(user_obj,instance)
	self.__applyBwLimit(user_obj,instance,"remove")
Beispiel #3
0
    def end(self,user_obj,instance):
	"""
	    called when this rule ends for user_obj	
	    
	    user_obj (User.User instance): object of user that this rule change for	    
	    instance (integer): instance number of user 	    
	"""
	ChargeRule.end(self,user_obj,instance)
	rule_duration=time.time() - user_obj.charge_info.rule_start[instance-1]
	if rule_duration>user_obj.charge_info.remaining_free_seconds[instance-1]:
	    user_obj.charge_info.remaining_free_seconds[instance-1]=0
	else:
	    user_obj.charge_info.remaining_free_seconds[instance-1]-=rule_duration
Beispiel #4
0
 def end(self, user_obj, instance):
     """
         called when this rule ends for user_obj     
         
         user_obj (User.User instance): object of user that this rule change for         
         instance (integer): instance number of user             
     """
     ChargeRule.end(self, user_obj, instance)
     rule_duration = time.time() - user_obj.charge_info.rule_start[instance
                                                                   - 1]
     if rule_duration > user_obj.charge_info.remaining_free_seconds[instance
                                                                    - 1]:
         user_obj.charge_info.remaining_free_seconds[instance - 1] = 0
     else:
         user_obj.charge_info.remaining_free_seconds[instance -
                                                     1] -= rule_duration