def create_assets_env(generator):
 theme_static_dir = generator.settings[u'THEME_STATIC_DIR']
 assets_destination = os.path.join(generator.output_path, theme_static_dir)
 generator.env.assets_environment = Environment(assets_destination, theme_static_dir)
 if (u'ASSET_CONFIG' in generator.settings):
  for item in generator.settings[u'ASSET_CONFIG']:
   generator.env.assets_environment.config[item[0]] = item[1]
 if (u'ASSET_BUNDLES' in generator.settings):
  for (name, args, kwargs) in generator.settings[u'ASSET_BUNDLES']:
   generator.env.assets_environment.register(name, *args, **kwargs)
 if (u'ASSET_DEBUG' in generator.settings):
  generator.env.assets_environment.debug = generator.settings[u'ASSET_DEBUG']
 elif (logging.getLevelName(logger.getEffectiveLevel()) == u'DEBUG'):
  generator.env.assets_environment.debug = True
 for path in (generator.settings[u'THEME_STATIC_PATHS'] + generator.settings.get(u'ASSET_SOURCE_PATHS', [])):
  full_path = os.path.join(generator.theme, path)
  generator.env.assets_environment.append_path(full_path)

def create_assets_env ( generator ) : theme_static_dir = generator . settings [ u'THEME_STATIC_DIR' ] assets_destination = os . path . join ( generator . output_path , theme_static_dir ) generator . env . assets_environment = Environment ( assets_destination , theme_static_dir ) if ( u'ASSET_CONFIG' in generator . settings ) : for item in generator . settings [ u'ASSET_CONFIG' ] : generator . env . assets_environment . config [ item [ 0 ] ] = item [ 1 ] if ( u'ASSET_BUNDLES' in generator . settings ) : for ( name , args , kwargs ) in generator . settings [ u'ASSET_BUNDLES' ] : generator . env . assets_environment . register ( name , * args , ** kwargs ) if ( u'ASSET_DEBUG' in generator . settings ) : generator . env . assets_environment . debug = generator . settings [ u'ASSET_DEBUG' ] elif ( logging . getLevelName ( logger . getEffectiveLevel ( ) ) == u'DEBUG' ) : generator . env . assets_environment . debug = True for path in ( generator . settings [ u'THEME_STATIC_PATHS' ] + generator . settings . get ( u'ASSET_SOURCE_PATHS' , [ ] ) ) : full_path = os . path . join ( generator . theme , path ) generator . env . assets_environment . append_path ( full_path )
define the assets environment and pass it to the generator .