mirror of
				https://github.com/craigerl/aprsd.git
				synced 2025-11-03 13:10:31 -05:00 
			
		
		
		
	Added fox for entry_points with old python
This commit is contained in:
		
							parent
							
								
									c43652dbea
								
							
						
					
					
						commit
						09b97086bc
					
				@ -1,6 +1,12 @@
 | 
				
			|||||||
CHANGES
 | 
					CHANGES
 | 
				
			||||||
=======
 | 
					=======
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					v3.3.4
 | 
				
			||||||
 | 
					------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* Fixed entry\_points
 | 
				
			||||||
 | 
					* Fix for entry\_points where python < 3.10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
v3.3.3
 | 
					v3.3.3
 | 
				
			||||||
------
 | 
					------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -123,10 +123,25 @@ def check_version(ctx):
 | 
				
			|||||||
def sample_config(ctx):
 | 
					def sample_config(ctx):
 | 
				
			||||||
    """Generate a sample Config file from aprsd and all installed plugins."""
 | 
					    """Generate a sample Config file from aprsd and all installed plugins."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def _get_selected_entry_points():
 | 
				
			||||||
 | 
					        import sys
 | 
				
			||||||
 | 
					        if sys.version_info < (3, 10):
 | 
				
			||||||
 | 
					            all = imp.entry_points()
 | 
				
			||||||
 | 
					            selected = []
 | 
				
			||||||
 | 
					            if "oslo.config.opts" in all:
 | 
				
			||||||
 | 
					                for x in all["oslo.config.opts"]:
 | 
				
			||||||
 | 
					                    if x.group == "oslo.config.opts":
 | 
				
			||||||
 | 
					                        selected.append(x)
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            selected = imp.entry_points(group="oslo.config.opts")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return selected
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_namespaces():
 | 
					    def get_namespaces():
 | 
				
			||||||
        args = []
 | 
					        args = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        selected = imp.entry_points(group="oslo.config.opts")
 | 
					        # selected = imp.entry_points(group="oslo.config.opts")
 | 
				
			||||||
 | 
					        selected = _get_selected_entry_points()
 | 
				
			||||||
        for entry in selected:
 | 
					        for entry in selected:
 | 
				
			||||||
            if "aprsd" in entry.name:
 | 
					            if "aprsd" in entry.name:
 | 
				
			||||||
                args.append("--namespace")
 | 
					                args.append("--namespace")
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user