def _inject_execstr(modname, import_tuples):
    if modname == 'utool':
        injecter = 'util_inject'
        injecter_import = ''
    else:
        injecter_import = 'import utool'
        injecter = 'utool'
    injectstr_fmt = textwrap.dedent(
        r'''
        {injecter_import}
        print, rrr, profile = {injecter}.inject2(__name__, '[{modname}]')
        def reassign_submodule_attributes(verbose=1):
            import sys
            if verbose and '--quiet' not in sys.argv:
                print('dev reimport')
            import {modname}
            seen_ = set([])
            for tup in IMPORT_TUPLES:
                if len(tup) > 2 and tup[2]:
                    continue
                submodname, fromimports = tup[0:2]
                submod = getattr({modname}, submodname)
                for attr in dir(submod):
                    if attr.startswith('_'):
                        continue
                    if attr in seen_:
                        continue
                    seen_.add(attr)
                    setattr({modname}, attr, getattr(submod, attr))
        def reload_subs(verbose=1):
            if verbose:
                print('Reloading {modname} submodules')
            rrr(verbose > 1)
            def wrap_fbrrr(mod):
                def fbrrr(*args, **kwargs):
                    if verbose > 0:
                        print('Auto-reload (using rrr) not setup for mod=%r' % (mod,))
                return fbrrr
            def get_rrr(mod):
                if hasattr(mod, 'rrr'):
                    return mod.rrr
                else:
                    return wrap_fbrrr(mod)
            def get_reload_subs(mod):
                return getattr(mod, 'reload_subs', wrap_fbrrr(mod))
            {reload_body}
            rrr(verbose > 1)
            try:
                reassign_submodule_attributes(verbose=verbose)
            except Exception as ex:
                print(ex)
        rrrr = reload_subs
        ''')
    injectstr_fmt = injectstr_fmt.replace('
    injectstr_fmt = injectstr_fmt.replace('
    rrrdir_fmt  = '    get_reload_subs({modname})(verbose=verbose)'
    rrrfile_fmt = '    get_rrr({modname})(verbose > 1)'
    def _reload_command(tup):
        if len(tup) > 2 and tup[2] is True:
            return rrrdir_fmt.format(modname=tup[0])
        else:
            return rrrfile_fmt.format(modname=tup[0])
    reload_body = '\n'.join(map(_reload_command, import_tuples)).strip()
    format_dict = {
        'modname': modname,
        'reload_body': reload_body,
        'injecter': injecter,
        'injecter_import': injecter_import,
    }
    inject_execstr = injectstr_fmt.format(**format_dict).strip()
    return inject_execstr