def LoadConfig(config_file_name, exit_fn=sys.exit):
 if config_file_name:
  config_file = open(config_file_name, 'r')
  try:
   bulkloader_config = imp.load_module('bulkloader_config', config_file, config_file_name, ('', 'r', imp.PY_SOURCE))
   sys.modules['bulkloader_config'] = bulkloader_config
   if hasattr(bulkloader_config, 'loaders'):
    for cls in bulkloader_config.loaders:
     Loader.RegisterLoader(cls())
   if hasattr(bulkloader_config, 'exporters'):
    for cls in bulkloader_config.exporters:
     Exporter.RegisterExporter(cls())
   if hasattr(bulkloader_config, 'mappers'):
    for cls in bulkloader_config.mappers:
     Mapper.RegisterMapper(cls())
  except NameError as e:
   m = re.search("[^']*'([^']*)'.*", str(e))
   if (m.groups() and (m.group(1) == 'Loader')):
    print >>sys.stderr, '\nThe config file format has changed and you appear to be using an old-style\nconfig file.  Please make the following changes:\n\n1. At the top of the file, add this:\n\nfrom google.appengine.tools.bulkloader import Loader\n\n2. For each of your Loader subclasses add the following at the end of the\n   __init__ definitioion:\n\nself.alias_old_names()\n\n3. At the bottom of the file, add this:\n\nloaders = [MyLoader1,...,MyLoaderN]\n\nWhere MyLoader1,...,MyLoaderN are the Loader subclasses you want the bulkloader\nto have access to.\n'
    exit_fn(1)
   else:
    raise
  except Exception as e:
   if (isinstance(e, NameClashError) or (('bulkloader_config' in vars()) and (hasattr(bulkloader_config, 'bulkloader') and isinstance(e, bulkloader_config.bulkloader.NameClashError)))):
    print >>sys.stderr, ('Found both %s and %s while aliasing old names on %s.' % (e.old_name, e.new_name, e.klass))
    exit_fn(1)
   else:
    raise

def LoadConfig ( config_file_name , exit_fn = sys . exit ) : if config_file_name : config_file = open ( config_file_name , 'r' ) try : bulkloader_config = imp . load_module ( 'bulkloader_config' , config_file , config_file_name , ( '' , 'r' , imp . PY_SOURCE ) ) sys . modules [ 'bulkloader_config' ] = bulkloader_config if hasattr ( bulkloader_config , 'loaders' ) : for cls in bulkloader_config . loaders : Loader . RegisterLoader ( cls ( ) ) if hasattr ( bulkloader_config , 'exporters' ) : for cls in bulkloader_config . exporters : Exporter . RegisterExporter ( cls ( ) ) if hasattr ( bulkloader_config , 'mappers' ) : for cls in bulkloader_config . mappers : Mapper . RegisterMapper ( cls ( ) ) except NameError as e : m = re . search ( "[^']*'([^']*)'.*" , str ( e ) ) if ( m . groups ( ) and ( m . group ( 1 ) == 'Loader' ) ) : print >> sys . stderr , '\nThe config file format has changed and you appear to be using an old-style\nconfig file.  Please make the following changes:\n\n1. At the top of the file, add this:\n\nfrom google.appengine.tools.bulkloader import Loader\n\n2. For each of your Loader subclasses add the following at the end of the\n   __init__ definitioion:\n\nself.alias_old_names()\n\n3. At the bottom of the file, add this:\n\nloaders = [MyLoader1,...,MyLoaderN]\n\nWhere MyLoader1,...,MyLoaderN are the Loader subclasses you want the bulkloader\nto have access to.\n' exit_fn ( 1 ) else : raise except Exception as e : if ( isinstance ( e , NameClashError ) or ( ( 'bulkloader_config' in vars ( ) ) and ( hasattr ( bulkloader_config , 'bulkloader' ) and isinstance ( e , bulkloader_config . bulkloader . NameClashError ) ) ) ) : print >> sys . stderr , ( 'Found both %s and %s while aliasing old names on %s.' % ( e . old_name , e . new_name , e . klass ) ) exit_fn ( 1 ) else : raise
initialize a configmanager with the specified options .