def iter_format_modules(lang):
 if check_for_language(lang):
  format_locations = ['django.conf.locale.%s']
  if settings.FORMAT_MODULE_PATH:
   format_locations.append((settings.FORMAT_MODULE_PATH + '.%s'))
   format_locations.reverse()
  locale = to_locale(lang)
  locales = [locale]
  if ('_' in locale):
   locales.append(locale.split('_')[0])
  for location in format_locations:
   for loc in locales:
    try:
     (yield import_module('.formats', (location % loc)))
    except ImportError:
     pass

def iter_format_modules ( lang ) : if check_for_language ( lang ) : format_locations = [ 'django.conf.locale.%s' ] if settings . FORMAT_MODULE_PATH : format_locations . append ( ( settings . FORMAT_MODULE_PATH + '.%s' ) ) format_locations . reverse ( ) locale = to_locale ( lang ) locales = [ locale ] if ( '_' in locale ) : locales . append ( locale . split ( '_' ) [ 0 ] ) for location in format_locations : for loc in locales : try : ( yield import_module ( '.formats' , ( location % loc ) ) ) except ImportError : pass
does the heavy lifting of finding format modules .