(html_files)
return dirs
Returns a dict of all main js modules, grouped by directory:
    {
        'locations/js': set(['locations/js/import', 'locations/js/location', ...  ]),
        'linked_domain/js': set(['linked_domain/js/domain_links']),
        ...
    }
Returns a dict of all main js modules, grouped by directory:
    {
        'locations/js': set(['locations/js/import', 'locations/js/location', ...  ]),
        'linked_domain/js': set(['linked_domain/js/domain_links']),
        ...
    }
Returns a dict of all main js modules grouped by directory : { locations / js : set ( [ locations / js / import locations / js / location ... ] ) linked_domain / js : set ( [ linked_domain / js / domain_links ] ) ... }
def _get_main_js_modules_by_dir(html_files):
    """
    Returns a dict of all main js modules, grouped by directory:
    {
        'locations/js': set(['locations/js/import', 'locations/js/location', ...  ]),
        'linked_domain/js': set(['linked_domain/js/domain_links']),
        ...
    }
    """
    dirs = defaultdict(set)
    for filename in html_files:
        proc = subprocess.Popen(["grep", r"^\s*{% requirejs_main [^%]* %}\s*$", filename],
                                stdout=subprocess.PIPE)
        (out, err) = proc.communicate()
        out = out.decode('utf-8')
        if out:
            match = re.search(r"{% requirejs_main .(([^%]*)/[^/%]*). %}", out)
            if match:
                main = match.group(1)
                directory = match.group(2)
                if os.path.exists(os.path.join(ROOT_DIR, 'staticfiles', main + '.js')):
                    dirs[directory].add(main)
    return dirs
def _get_main_js_modules_by_dir ( html_files ) : dirs = defaultdict ( set ) for filename in html_files : proc = subprocess . Popen ( [ "grep" , r"^\s*{% requirejs_main [^%]* %}\s*$" , filename ] , stdout = subprocess . PIPE ) ( out , err ) = proc . communicate ( ) out = out . decode ( 'utf-8' ) if out : match = re . search ( r"{% requirejs_main .(([^%]*)/[^/%]*). %}" , out ) if match : main = match . group ( 1 ) directory = match . group ( 2 ) if os . path . exists ( os . path . join ( ROOT_DIR , 'staticfiles' , main + '.js' ) ) : dirs [ directory ] . add ( main ) return dirs