run.py
def run(ctx, script_or_uri, force_import):
    """
    Run a script or uri.
    """
    group_name = ctx.parent.command.name + ' ' if ctx.parent else ''
    prog_name = "{}{}".format(group_name, ctx.command.name)

    sys.argv = [prog_name] + ctx.args
    try:
        ret = None

        entry = import_obj(script_or_uri, hard=force_import)
        if entry:
            ret = entry()
            # Backward compatibility: if ret is int,
            # means it's cli return code.
            if isinstance(entry, int):
                sys.exit(ret)
        else:
            execfile(script_or_uri, {
                '__name__': '__main__',
                '__file__': os.path.realpath(script_or_uri),
            })
    except SystemExit:
        raise
    except BaseException:
        raise

    Run a script or uri.
    
Run a script or uri.
Run a script or uri .
def run(ctx, script_or_uri, force_import):
    group_name = ctx.parent.command.name + ' ' if ctx.parent else ''
    prog_name = "{}{}".format(group_name, ctx.command.name)
    sys.argv = [prog_name] + ctx.args
    try:
        ret = None
        entry = import_obj(script_or_uri, hard=force_import)
        if entry:
            ret = entry()
            if isinstance(entry, int):
                sys.exit(ret)
        else:
            execfile(script_or_uri, {
                '__name__': '__main__',
                '__file__': os.path.realpath(script_or_uri),
            })
    except SystemExit:
        raise
    except BaseException:
        raise
def run ( ctx , script_or_uri , force_import ) : group_name = ctx . parent . command . name + ' ' if ctx . parent else '' prog_name = "{}{}" . format ( group_name , ctx . command . name ) sys . argv = [ prog_name ] + ctx . args try : ret = None entry = import_obj ( script_or_uri , hard = force_import ) if entry : ret = entry ( ) if isinstance ( entry , int ) : sys . exit ( ret ) else : execfile ( script_or_uri , { '__name__' : '__main__' , '__file__' : os . path . realpath ( script_or_uri ) , } ) except SystemExit : raise except BaseException : raise
Run a script or uri.
Run a script or uri .
"""
    Run a script or uri.
    """ # Backward compatibility: if ret is int, # means it's cli return code.
ctx
script_or_uri
force_import