mirror of
				https://github.com/craigerl/aprsd.git
				synced 2025-11-04 05:30:27 -05:00 
			
		
		
		
	The example plugin, used verbatim, complains about an abstract class. The interface requires 'process' not 'command'.
		
			
				
	
	
		
			21 lines
		
	
	
		
			409 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			409 B
		
	
	
	
		
			Python
		
	
	
	
	
	
import logging
 | 
						|
 | 
						|
from aprsd import plugin
 | 
						|
 | 
						|
 | 
						|
LOG = logging.getLogger("APRSD")
 | 
						|
 | 
						|
 | 
						|
class HelloPlugin(plugin.APRSDRegexCommandPluginBase):
 | 
						|
    """Hello World."""
 | 
						|
 | 
						|
    version = "1.0"
 | 
						|
    # matches any string starting with h or H
 | 
						|
    command_regex = "^[hH]"
 | 
						|
    command_name = "hello"
 | 
						|
 | 
						|
    def process(self, packet):
 | 
						|
        LOG.info("HelloPlugin")
 | 
						|
        reply = f"Hello '{packet.from_call}'"
 | 
						|
        return reply
 |