#NEWLINE# def create_settings( ) : #NEWLINE# #INDENT# res = type ( '' , ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# res . files = files . copy ( ) #NEWLINE# if hasattr ( django_settings , 'CITIES_FILES' ) : #NEWLINE# #INDENT# for key in list ( django_settings . CITIES_FILES . keys ( ) ) : #NEWLINE# #INDENT# if ( ( 'filenames' in django_settings . CITIES_FILES [ key ] ) and ( 'filename' in django_settings . CITIES_FILES [ key ] ) ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ( "Only one key should be specified for '%s': 'filename' of 'filenames'. Both specified instead" % key ) ) #NEWLINE# #UNINDENT# res . files [ key ] . update ( django_settings . CITIES_FILES [ key ] ) #NEWLINE# if ( 'filenames' in django_settings . CITIES_FILES [ locales ] ) : #NEWLINE# #INDENT# del res . files [ key ] [ 'filename' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if hasattr ( django_settings , 'CITIES_LOCALES' ) : #NEWLINE# #INDENT# locales = django_settings . CITIES_LOCALES [ : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# locales = [ 'en' , 'und' ] #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# locales . remove ( 'LANGUAGES' ) #NEWLINE# locales += [ e [ 0 ] for e in django_settings . LANGUAGES ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# res . locales = set ( [ e . lower ( ) for e in locales ] ) #NEWLINE# if hasattr ( django_settings , 'CITIES_POSTAL_CODES' ) : #NEWLINE# #INDENT# res . postal_codes = set ( [ e . upper ( ) for e in django_settings . CITIES_POSTAL_CODES ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# res . postal_codes = set ( ) #NEWLINE# #UNINDENT# return res