mirror of
				https://github.com/craigerl/aprsd.git
				synced 2025-10-31 04:40:22 -04:00 
			
		
		
		
	
		
			
	
	
		
			17 lines
		
	
	
		
			370 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			17 lines
		
	
	
		
			370 B
		
	
	
	
		
			Python
		
	
	
	
	
	
|  | """Utilities and helper functions.""" | ||
|  | 
 | ||
|  | import os | ||
|  | import pprint | ||
|  | import sys | ||
|  | 
 | ||
|  | 
 | ||
|  | def env(*vars, **kwargs): | ||
|  |     """This returns the first environment variable set.
 | ||
|  |     if none are non-empty, defaults to '' or keyword arg default | ||
|  |     """
 | ||
|  |     for v in vars: | ||
|  |         value = os.environ.get(v, None) | ||
|  |         if value: | ||
|  |             return value | ||
|  |     return kwargs.get('default', '') |