#NEWLINE# def remove_missing_formats_from_publication( directory ) : #NEWLINE# #INDENT# "Removes data formats that haven't been created\n    from publishing to CKAN.\n        \n    " #NEWLINE# formats = [ ] #NEWLINE# for exp_format in args . formats : #NEWLINE# #INDENT# logger . debug ( 'Checking for export format {0}' . format ( exp_dir ) ) #NEWLINE# exp_dir = None #NEWLINE# if ( exp_format == 'shp' ) : #NEWLINE# #INDENT# exp_dir = 'shape' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( exp_format == 'dwg' ) : #NEWLINE# #INDENT# exp_dir = 'cad' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# exp_dir = exp_format #NEWLINE# #UNINDENT# #UNINDENT# exp_dir = os . path . join ( directory , exp_dir ) #NEWLINE# if os . path . exists ( exp_dir ) : #NEWLINE# #INDENT# formats . append ( exp_format ) #NEWLINE# #UNINDENT# #UNINDENT# args . formats = formats