How to use the ckanapi.cli.main.__doc__.split function in ckanapi

To help you get started, we’ve selected a few ckanapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckan / ckanapi / ckanapi / cli / paster.py View on Github external
pass

class _DelegateParsing(object):
    usage = main.__doc__

    def parse_args(self, args):
        assert sys.argv[1:3] == ['--plugin=ckanapi', 'ckanapi'], sys.argv
        del sys.argv[1:3]
        arguments = main.parse_arguments()
        cfg = arguments['--config']
        options = _Options()
        options.config = cfg if cfg is not None else './development.ini'
        return options, []

class CKANAPICommand(CkanCommand):
    summary = main.__doc__.split('\n')[0]
    usage = main.__doc__
    parser = _DelegateParsing()

    def command(self):
        self._load_config()

        return main.main(running_with_paster=True)