コード例 #1
0
ファイル: main_list.py プロジェクト: jacoblsmith/conda
def execute(args, parser):
    prefix = common.get_prefix(args)

    regex = args.regex
    if args.full_name:
        regex = r'^%s$' % regex

    if args.revisions:
        from conda.history import History

        h = History(prefix)
        if isfile(h.path):
            if not args.json:
                h.print_log()
            else:
                common.stdout_json(h.object_log())
        else:
            common.error_and_exit("No revision log found: %s\n" % h.path,
                                  json=args.json,
                                  error_type="NoRevisionLog")
        return

    if args.canonical:
        format = 'canonical'
    elif args.export:
        format = 'export'
    else:
        format = 'human'

    if args.json:
        format = 'canonical'

    exitcode = print_packages(prefix, regex, format, piplist=args.pip, json=args.json)
    sys.exit(exitcode)
コード例 #2
0
ファイル: main_list.py プロジェクト: zeyaddeeb/conda
def execute(args, parser):
    prefix = common.get_prefix(args)

    regex = args.regex
    if args.full_name:
        regex = r'^%s$' % regex

    if args.revisions:
        from conda.history import History

        h = History(prefix)
        if isfile(h.path):
            if not args.json:
                h.print_log()
            else:
                common.stdout_json(h.object_log())
        else:
            common.error_and_exit("No revision log found: %s\n" % h.path,
                                  json=args.json,
                                  error_type="NoRevisionLog")
        return

    if args.canonical:
        format = 'canonical'
    elif args.export:
        format = 'export'
    else:
        format = 'human'

    if args.json:
        format = 'canonical'

    print_packages(prefix, regex, format, piplist=args.pip, json=args.json)
コード例 #3
0
ファイル: main_list.py プロジェクト: ESSS/conda
def execute(args, parser):
    prefix = context.prefix_w_legacy_search
    regex = args.regex
    if args.full_name:
        regex = r'^%s$' % regex

    if args.revisions:
        from conda.history import History
        h = History(prefix)
        if isfile(h.path):
            if not context.json:
                h.print_log()
            else:
                stdout_json(h.object_log())
        else:
            raise CondaFileNotFoundError(h.path)
        return

    if args.explicit:
        print_explicit(prefix, args.md5)
        return

    if args.canonical:
        format = 'canonical'
    elif args.export:
        format = 'export'
    else:
        format = 'human'
    if context.json:
        format = 'canonical'

    exitcode = print_packages(prefix, regex, format, piplist=args.pip,
                              json=context.json,
                              show_channel_urls=context.show_channel_urls)
    return exitcode
コード例 #4
0
ファイル: main_list.py プロジェクト: jeanconn/conda
def execute(args, parser):
    prefix = common.get_prefix(args)

    if args.revisions:
        from conda.history import History

        h = History(prefix)
        if isfile(h.path):
            if not args.json:
                h.print_log()
            else:
                common.stdout_json(h.object_log())
        else:
            common.error_and_exit("No revision log found: %s\n" % h.path, json=args.json, error_type="NoRevisionLog")
        return

    if args.canonical:
        format = "canonical"
    elif args.export:
        format = "export"
    else:
        format = "human"

    if args.json:
        format = "canonical"

    print_packages(prefix, args.regex, format, piplist=args.pip, json=args.json)
コード例 #5
0
def execute(args, parser):
    prefix = context.prefix_w_legacy_search

    regex = args.regex
    if args.full_name:
        regex = r'^%s$' % regex

    if args.revisions:
        from conda.history import History

        h = History(prefix)
        if isfile(h.path):
            if not args.json:
                h.print_log()
            else:
                stdout_json(h.object_log())
        else:
            raise CondaFileNotFoundError(
                h.path, "No revision log found: %s\n" % h.path)
        return

    if args.explicit:
        print_explicit(prefix, args.md5)
        return

    if args.canonical:
        format = 'canonical'
    elif args.export:
        print_explicit(prefix, args.md5)
        return
    else:
        format = 'human'

    if args.json:
        format = 'canonical'

    exitcode = print_packages(prefix,
                              regex,
                              format,
                              piplist=args.pip,
                              json=args.json,
                              show_channel_urls=args.show_channel_urls)
    return exitcode