#NEWLINE# def clean_built( self , storage ) : #NEWLINE# #INDENT# "\n        Clear any static files that aren't from the apps.\n\n        " #NEWLINE# ( build_dirs , built_files ) = self . find_all ( storage ) #NEWLINE# found_files = set ( ) #NEWLINE# for finder in finders . get_finders ( ) : #NEWLINE# #INDENT# for ( path , s ) in finder . list ( [ ] ) : #NEWLINE# #INDENT# if getattr ( s , 'prefix' , None ) : #NEWLINE# #INDENT# prefixed_path = os . path . join ( s . prefix , path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# prefixed_path = path #NEWLINE# #UNINDENT# found_files . add ( prefixed_path ) #NEWLINE# #UNINDENT# #UNINDENT# stale_files = ( built_files - found_files ) #NEWLINE# for fpath in stale_files : #NEWLINE# #INDENT# self . log ( ( "Deleting '%s'" % smart_unicode ( fpath ) ) , level = 1 ) #NEWLINE# storage . delete ( fpath ) #NEWLINE# #UNINDENT# found_dirs = set ( ) #NEWLINE# for f in found_files : #NEWLINE# #INDENT# path = f #NEWLINE# while True : #NEWLINE# #INDENT# path = os . path . dirname ( path ) #NEWLINE# found_dirs . add ( path ) #NEWLINE# if ( not path ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# stale_dirs = ( set ( build_dirs ) - found_dirs ) #NEWLINE# for fpath in stale_dirs : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# storage . delete ( fpath ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# self . log ( ( "Couldn't remove empty directory '%s'" % smart_unicode ( fpath ) ) , level = 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . log ( ( "Deleted empty directory '%s'" % smart_unicode ( fpath ) ) , level = 1 )