parameters: (self, path)
return_statement: return ls
docstring: Recursively delete unaccepted files based on their mimetype
          and return the final number or files in the directory.
docstring_summary: Recursively delete unaccepted files based on their mimetype
          and return the final number or files in the directory.
docstring_tokens: Recursively delete unaccepted files based on their mimetype and return the final number or files in the directory .
function: def _remove_unaccepted_files(self, path):
          """
          Recursively delete unaccepted files based on their mimetype
          and return the final number or files in the directory.
          """
          ls = []
          for p in map(lambda x:os.path.join(path, x), os.listdir(path)):
              if os.path.islink(p):
                  raise Exception(ElfinderErrorMessages.ERROR_ARC_SYMLINKS)
              mime = self._local_file_mimetype(p)
              if not self.mime_accepted(mime) or not self._name_accepted(self._basename(p)):
                  if mime != 'directory':
                      os.unlink(p)
                  else:
                      shutil.rmtree(p)
              elif mime != 'directory' or self._remove_unaccepted_files(p):
                  ls.append(p)
          return ls
function_tokens: def _remove_unaccepted_files ( self , path ) : ls = [ ] for p in map ( lambda x : os . path . join ( path , x ) , os . listdir ( path ) ) : if os . path . islink ( p ) : raise Exception ( ElfinderErrorMessages . ERROR_ARC_SYMLINKS ) mime = self . _local_file_mimetype ( p ) if not self . mime_accepted ( mime ) or not self . _name_accepted ( self . _basename ( p ) ) : if mime != 'directory' : os . unlink ( p ) else : shutil . rmtree ( p ) elif mime != 'directory' or self . _remove_unaccepted_files ( p ) : ls . append ( p ) return ls