minor tweaks
This commit is contained in:
		
							parent
							
								
									2458fb3616
								
							
						
					
					
						commit
						4a1640d1c3
					
				|  | @ -28,7 +28,7 @@ class sat: | ||||||
| 
 | 
 | ||||||
|     def check_command_q(self): |     def check_command_q(self): | ||||||
|         cur_batch = [] |         cur_batch = [] | ||||||
|         with open("test_q","r") as q: |         with open("command_q","r") as q: | ||||||
|             com_q = q.read().splitlines() |             com_q = q.read().splitlines() | ||||||
|             for com in com_q: |             for com in com_q: | ||||||
|                 if int(com.split(":")[0]) == self.modules["heartbeat"].mod_get("MTE")[0]: |                 if int(com.split(":")[0]) == self.modules["heartbeat"].mod_get("MTE")[0]: | ||||||
|  | @ -50,7 +50,7 @@ class sat: | ||||||
|                 elif com[1] == "SET" and len(com) == 5: |                 elif com[1] == "SET" and len(com) == 5: | ||||||
|                     res = self.modules[com[2]].mod_set(com[3],com[4]) |                     res = self.modules[com[2]].mod_set(com[3],com[4]) | ||||||
|                 elif com[1] == "EXE" and len(com) == 5: |                 elif com[1] == "EXE" and len(com) == 5: | ||||||
|                     res = self.modules[com[2]].mod_exe(com[3],com[4]) |                     res = self.modules[com[2]].mod_exe(com[3],com[3]) | ||||||
|                 else: |                 else: | ||||||
|                     res = (-1, "BAD COMMAND: " + c) |                     res = (-1, "BAD COMMAND: " + c) | ||||||
|                 print(res) |                 print(res) | ||||||
|  | @ -60,6 +60,12 @@ class sat: | ||||||
|             if self.modules["heartbeat"].mod_get("kill")[0] == 1: |             if self.modules["heartbeat"].mod_get("kill")[0] == 1: | ||||||
|                 print("heading to bed") |                 print("heading to bed") | ||||||
|                 return |                 return | ||||||
|  | 
 | ||||||
|  |             with open("status", "r+") as statfile: | ||||||
|  |                 statfile.seek(0) | ||||||
|  |                 statfile.truncate() | ||||||
|  |                 statfile.write(str(MTE)) | ||||||
|  | 
 | ||||||
|             sleep(1) |             sleep(1) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Laika
						Laika