a8a37622f0ef987ca83c9b401700d0fcbece9b70,sos/__main__.py,,cmd_convert,#Any#Any#,129

Before Change


    from .utils import env, get_traceback
    try:
        from_format = os.path.splitext(args.from_file)[-1][1:]
        if args.__to_format__:
            to_format = args.__to_format__
        elif args.to_file:
            to_format = os.path.splitext(args.to_file)[-1][1:]
        else:
            raise ValueError("Please specify either desination file or format")
        //
        if args.list:
            list_converter(from_format, to_format)
            sys.exit(0)
        else:

After Change


def cmd_convert(args, unknown_args):
    from .utils import env, get_traceback
    try:
        for entrypoint in pkg_resources.iter_entry_points(group="sos_converters"):
            try:
                if entrypoint.name == args.converter_name + ".func":
                    func = entrypoint.load()
                    func(args.from_file, args.to_file, args, unknown_args)
            except Exception as e:
                raise RuntimeError("Failed to load converter {}: {}".format(entrypoint.name, e))
    except Exception as e:
        // if no other parameter, with option list all
        if args.verbosity and args.verbosity > 2:
            sys.stderr.write(get_traceback())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: vatlab/SoS
Commit Name: a8a37622f0ef987ca83c9b401700d0fcbece9b70
Time: 2016-12-12
Author: ben.bog@gmail.com
File Name: sos/__main__.py
Class Name:
Method Name: cmd_convert


Project Name: vatlab/SoS
Commit Name: a8a37622f0ef987ca83c9b401700d0fcbece9b70
Time: 2016-12-12
Author: ben.bog@gmail.com
File Name: sos/__main__.py
Class Name:
Method Name: cmd_convert


Project Name: vatlab/SoS
Commit Name: 98cf326ac0db20159996a1095ff1e8dba80b0465
Time: 2016-11-19
Author: ben.bog@gmail.com
File Name: sos/actions.py
Class Name:
Method Name: sos_run


Project Name: vatlab/SoS
Commit Name: b3192bf244120efa901cc9c46fe36fb6fb501803
Time: 2016-11-19
Author: ben.bog@gmail.com
File Name: sos/__main__.py
Class Name:
Method Name: cmd_run