Добавлен класс alert
This commit is contained in:
		
							parent
							
								
									0b14e5b62b
								
							
						
					
					
						commit
						5408a911e5
					
				
							
								
								
									
										28
									
								
								libpyrr/headers/alert_h.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								libpyrr/headers/alert_h.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
from ..utils import Enum
 | 
			
		||||
 | 
			
		||||
class Alert(object):
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        self.category_t = Enum({
 | 
			
		||||
                          'error_notification':         0x1,
 | 
			
		||||
                          'peer_notification':          0x2,
 | 
			
		||||
                          'port_mapping_notification':  0x4,
 | 
			
		||||
                          'storage_notification':       0x8,
 | 
			
		||||
                          'tracker_notification':       0x10,
 | 
			
		||||
                          'debug_notification':         0x20,
 | 
			
		||||
                          'status_notification':        0x40,
 | 
			
		||||
                          'progress_notification':      0x80,
 | 
			
		||||
                          'ip_block_notification':      0x100,
 | 
			
		||||
                          'performance_warning':        0x200,
 | 
			
		||||
                          'dht_notification':           0x400,
 | 
			
		||||
                          'dht_notification':           0x400,
 | 
			
		||||
                          'session_log_notification':   0x2000,
 | 
			
		||||
                          'torrent_log_notification':   0x4000,
 | 
			
		||||
                          'peer_log_notification':      0x8000,
 | 
			
		||||
                          'incoming_request_notification':  0x10000,
 | 
			
		||||
                          'dht_log_notification':           0x20000,
 | 
			
		||||
                          'dht_operation_notification':     0x40000,
 | 
			
		||||
                          'port_mapping_log_notification':  0x80000,
 | 
			
		||||
                          'picker_log_notification':        0x100000,
 | 
			
		||||
                          'all_categories':                 0x7fffffff
 | 
			
		||||
                          })
 | 
			
		||||
alert = Alert()
 | 
			
		||||
							
								
								
									
										13
									
								
								libpyrr/utils.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								libpyrr/utils.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
class AttrDict(dict):
 | 
			
		||||
    def __getattr__(self, attr):
 | 
			
		||||
        return self[attr]
 | 
			
		||||
    def __setattr__(self, attr, value):
 | 
			
		||||
        self[attr] = value
 | 
			
		||||
 | 
			
		||||
class Enum(dict):
 | 
			
		||||
    def __getattr__(self, attr):
 | 
			
		||||
        return self[attr]
 | 
			
		||||
    def __setattr__(self, attr, value):
 | 
			
		||||
        pass
 | 
			
		||||
    def __setitem__(self, k, v):
 | 
			
		||||
        pass
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user