Compare commits
	
		
			No commits in common. "a6284539acd7a1b91de8b330a498d367c57876d9" and "3e80a6effb23cce90c6e06d3f039eddd773f6d4f" have entirely different histories.
		
	
	
		
			a6284539ac
			...
			3e80a6effb
		
	
		
							
								
								
									
										7
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								main.py
									
									
									
									
									
								
							| @ -7,7 +7,6 @@ import sys | |||||||
| import os | import os | ||||||
| import threading | import threading | ||||||
| import importlib | import importlib | ||||||
| import imp |  | ||||||
| 
 | 
 | ||||||
| # global variables | # global variables | ||||||
| STOP_REQUESTED = False | STOP_REQUESTED = False | ||||||
| @ -173,12 +172,6 @@ def queue_processor(): | |||||||
|                         if len(command) >= 2 and command[0] == "module": |                         if len(command) >= 2 and command[0] == "module": | ||||||
|                             if command[1] == "reload": |                             if command[1] == "reload": | ||||||
|                                 print("[INFO] Module reloading triggered by a command") |                                 print("[INFO] Module reloading triggered by a command") | ||||||
| 
 |  | ||||||
|                                 # properly reload all v2 modules |  | ||||||
|                                 for mod in mcu.modules: |  | ||||||
|                                     if mod.version == 2: |  | ||||||
|                                         imp.reload(mod.obj) |  | ||||||
| 
 |  | ||||||
|                                 del mcu.modules[:] |                                 del mcu.modules[:] | ||||||
|                                 mcu.reload_modules() |                                 mcu.reload_modules() | ||||||
|                          |                          | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ import sys | |||||||
| import os | import os | ||||||
| import threading | import threading | ||||||
| import importlib | import importlib | ||||||
| import imp |  | ||||||
| 
 | 
 | ||||||
| from telegram import Message, Chat | from telegram import Message, Chat | ||||||
| 
 | 
 | ||||||
| @ -176,12 +175,6 @@ def queue_processor(): | |||||||
|                         if len(command) >= 2 and command[0] == "module": |                         if len(command) >= 2 and command[0] == "module": | ||||||
|                             if command[1] == "reload": |                             if command[1] == "reload": | ||||||
|                                 print("[INFO] Module reloading triggered by a command") |                                 print("[INFO] Module reloading triggered by a command") | ||||||
| 
 |  | ||||||
|                                 # properly reload all v2 modules |  | ||||||
|                                 for mod in mcu.modules: |  | ||||||
|                                     if mod.version == 2: |  | ||||||
|                                         imp.reload(mod.obj) |  | ||||||
| 
 |  | ||||||
|                                 del mcu.modules[:] |                                 del mcu.modules[:] | ||||||
|                                 mcu.reload_modules() |                                 mcu.reload_modules() | ||||||
|                          |                          | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ class Counter: | |||||||
| 
 | 
 | ||||||
|     def call_count(self): |     def call_count(self): | ||||||
|         self.counter += 1 |         self.counter += 1 | ||||||
|         return self.counter |         return self.counter.et | ||||||
| 
 | 
 | ||||||
| c = Counter() | c = Counter() | ||||||
| 
 | 
 | ||||||
| @ -13,4 +13,4 @@ def get_num(): | |||||||
| 
 | 
 | ||||||
| def process(message, path): | def process(message, path): | ||||||
|     if message.text == "!v2-testing": |     if message.text == "!v2-testing": | ||||||
|         return f"Testing successful - call number {get_num()}" |         return f"Testing successful - this is call number {get_num()}" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user