How to use the ckanapi.cli.main.__doc__ 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
import sys
from ckan.lib.cli import CkanCommand

from ckanapi.cli import main

class _Options(object):
    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):