def get_theme_sass_dirs(system, theme_dir):
 if (system not in ('lms', 'cms')):
  raise ValueError('"system" must either be "lms" or "cms"')
 dirs = []
 system_sass_dir = ((path(system) / 'static') / 'sass')
 sass_dir = (((theme_dir / system) / 'static') / 'sass')
 css_dir = (((theme_dir / system) / 'static') / 'css')
 dependencies = SASS_LOOKUP_DEPENDENCIES.get(system, [])
 if sass_dir.isdir():
  css_dir.mkdir_p()
  dirs.append({'sass_source_dir': system_sass_dir, 'css_destination_dir': css_dir, 'lookup_paths': (dependencies + [(sass_dir / 'partials'), (system_sass_dir / 'partials'), system_sass_dir])})
  dirs.append({'sass_source_dir': sass_dir, 'css_destination_dir': css_dir, 'lookup_paths': (dependencies + [(sass_dir / 'partials'), (system_sass_dir / 'partials'), system_sass_dir])})
 return dirs

def get_theme_sass_dirs ( system , theme_dir ) : if ( system not in ( 'lms' , 'cms' ) ) : raise ValueError ( '"system" must either be "lms" or "cms"' ) dirs = [ ] system_sass_dir = ( ( path ( system ) / 'static' ) / 'sass' ) sass_dir = ( ( ( theme_dir / system ) / 'static' ) / 'sass' ) css_dir = ( ( ( theme_dir / system ) / 'static' ) / 'css' ) dependencies = SASS_LOOKUP_DEPENDENCIES . get ( system , [ ] ) if sass_dir . isdir ( ) : css_dir . mkdir_p ( ) dirs . append ( { 'sass_source_dir' : system_sass_dir , 'css_destination_dir' : css_dir , 'lookup_paths' : ( dependencies + [ ( sass_dir / 'partials' ) , ( system_sass_dir / 'partials' ) , system_sass_dir ] ) } ) dirs . append ( { 'sass_source_dir' : sass_dir , 'css_destination_dir' : css_dir , 'lookup_paths' : ( dependencies + [ ( sass_dir / 'partials' ) , ( system_sass_dir / 'partials' ) , system_sass_dir ] ) } ) return dirs
return list of sass dirs that need to be compiled for the given theme .