optimize
This commit is contained in:
		
							
								
								
									
										11
									
								
								owrx/aprs.py
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								owrx/aprs.py
									
									
									
									
									
								
							@@ -134,17 +134,20 @@ class AprsParser(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        information = information.decode(encoding, "replace")
 | 
					        information = information.decode(encoding, "replace")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if information[0] == "!" or information[0] == "=":
 | 
					        # APRS data type identifier
 | 
				
			||||||
 | 
					        dti = information[0]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if dti == "!" or dti == "=":
 | 
				
			||||||
            # position without timestamp
 | 
					            # position without timestamp
 | 
				
			||||||
            aprsData.update(self.parseRegularAprsData(information[1:]))
 | 
					            aprsData.update(self.parseRegularAprsData(information[1:]))
 | 
				
			||||||
        elif information[0] == "/" or information[0] == "@":
 | 
					        elif dti == "/" or dti == "@":
 | 
				
			||||||
            # position with timestamp
 | 
					            # position with timestamp
 | 
				
			||||||
            aprsData["timestamp"] = self.parseTimestamp(information[1:8])
 | 
					            aprsData["timestamp"] = self.parseTimestamp(information[1:8])
 | 
				
			||||||
            aprsData.update(self.parseRegularAprsData(information[8:]))
 | 
					            aprsData.update(self.parseRegularAprsData(information[8:]))
 | 
				
			||||||
        elif information[0] == ">":
 | 
					        elif dti == ">":
 | 
				
			||||||
            # status update
 | 
					            # status update
 | 
				
			||||||
            aprsData.update(self.parseStatusUpate(information[1:]))
 | 
					            aprsData.update(self.parseStatusUpate(information[1:]))
 | 
				
			||||||
        elif information[0] == "}":
 | 
					        elif dti == "}":
 | 
				
			||||||
            # third party
 | 
					            # third party
 | 
				
			||||||
            aprsData["type"] = "thirdparty"
 | 
					            aprsData["type"] = "thirdparty"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user