Changeset - 2b8478ef0b6f
[Not reviewed]
0 1 0
Lance Edgar - 5 years ago 2020-02-27 21:52:50
lance@edbob.org
Fallback to default handler when no config available

e.g. when showing help for the command
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general) First comment
rattail_corepos/commands.py
Show inline comments
 
@@ -46,8 +46,11 @@ class ImportCOREPOS(commands.ImportSubcommand):
 
                            "Defaults to 'default'.")
 

	
 
    def get_handler_factory(self, **kwargs):
 
        spec = self.config.get('rattail.importing', 'corepos.handler',
 
                               default='rattail_corepos.importing.corepos:FromCOREPOSToRattail')
 
        if self.config:
 
            spec = self.config.get('rattail.importing', 'corepos.handler',
 
                                   default='rattail_corepos.importing.corepos:FromCOREPOSToRattail')
 
        else:
 
            spec = 'rattail_corepos.importing.corepos:FromCOREPOSToRattail'
 
        return load_object(spec)
 

	
 
    def get_handler_kwargs(self, **kwargs):
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now