kolibri/utils/cli.py
def parse_args(args=None):
    """
    Parses arguments by invoking docopt. Arguments for django management
    commands are split out before returning.

    :returns: (parsed_arguments, raw_django_ars)
    """

    if not args:
        args = sys.argv[1:]

    # Split out the parts of the argument list that we pass on to Django
    # and don't feed to docopt.
    if "--" in args:
        # At the moment, we keep this for backwards-compatibility and in case there
        # is a real case of having to force the parsing of DJANGO_OPTIONS to a
        # specific location. Example:
        # kolibri manage commandname --non-django-arg -- --django-arg
        pivot = args.index("--")
        args, django_args = args[:pivot], args[pivot + 1 :]
    elif "manage" in args:
        # Include "manage COMMAND" for docopt parsing, but split out the rest
        pivot = args.index("manage") + 2
        args, django_args = args[:pivot], args[pivot:]
    else:
        django_args = []

    docopt_kwargs = dict(version=str(kolibri.__version__), options_first=False)

    if args:
        docopt_kwargs["argv"] = args

    return docopt(USAGE, **docopt_kwargs), django_args

    Parses arguments by invoking docopt. Arguments for django management
    commands are split out before returning.

    :returns: (parsed_arguments, raw_django_ars)
    
Parses arguments by invoking docopt. Arguments for django management
commands are split out before returning.
Parses arguments by invoking docopt . Arguments for django management commands are split out before returning .
def parse_args(args=None):
    if not args:
        args = sys.argv[1:]
    if "--" in args:
        pivot = args.index("--")
        args, django_args = args[:pivot], args[pivot + 1 :]
    elif "manage" in args:
        pivot = args.index("manage") + 2
        args, django_args = args[:pivot], args[pivot:]
    else:
        django_args = []
    docopt_kwargs = dict(version=str(kolibri.__version__), options_first=False)
    if args:
        docopt_kwargs["argv"] = args
    return docopt(USAGE, **docopt_kwargs), django_args
def parse_args ( args = None ) : if not args : args = sys . argv [ 1 : ] if "--" in args : pivot = args . index ( "--" ) args , django_args = args [ : pivot ] , args [ pivot + 1 : ] elif "manage" in args : pivot = args . index ( "manage" ) + 2 args , django_args = args [ : pivot ] , args [ pivot : ] else : django_args = [ ] docopt_kwargs = dict ( version = str ( kolibri . __version__ ) , options_first = False ) if args : docopt_kwargs [ "argv" ] = args return docopt ( USAGE , ** docopt_kwargs ) , django_args
Parses arguments by invoking docopt.
Parses arguments by invoking docopt .
"""
    Parses arguments by invoking docopt. Arguments for django management
    commands are split out before returning.

    :returns: (parsed_arguments, raw_django_ars)
    """ # Split out the parts of the argument list that we pass on to Django # and don't feed to docopt. # At the moment, we keep this for backwards-compatibility and in case there # is a real case of having to force the parsing of DJANGO_OPTIONS to a # specific location. Example: # kolibri manage commandname --non-django-arg -- --django-arg # Include "manage COMMAND" for docopt parsing, but split out the rest
None
args